Skip to content

Instantly share code, notes, and snippets.

View king-11's full-sized avatar
🎯
Targeting

Lakshya Singh king-11

🎯
Targeting
View GitHub Profile
@king-11
king-11 / migrate-hugo-to-astro.py
Created May 18, 2025 02:02
A script to migrate content from hugo to astro which uses admonitions
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["pyyaml"]
# ///
# Hugo to Astro Blog Migration Script
# Migrates posts from Hugo format to Astro format with user confirmation for each post
import os

Boat Racing

You manage to sign up as a competitor in the boat races just in time. The organizer explains that it's not really a traditional race - instead, you will get a fixed amount of time during which your boat has to travel as far as it can, and you win if your boat goes the farthest.

As part of signing up, you get a sheet of paper (your puzzle input) that lists the time allowed for each race and also the best distance ever recorded in that race. To guarantee you win the grand prize, you need to make sure you go farther in each race than the current record holder.

The organizer brings you over to the area where the boat races are held. The boats are much smaller than you expected - they're actually toy boats, each with a big button on top. Holding down the button charges the boat, and releasing the button allows the boat to move. Boats move faster if their button was held longer, but time spent holding the button counts against the total race time. You can only hold the button at the start of the ra

@king-11
king-11 / renew-gpgkey.md
Created August 23, 2021 08:07 — forked from krisleech/renew-gpgkey.md
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@king-11
king-11 / blocking_action.c
Created July 10, 2021 17:22
Qthread socket debugging
#include <stdio.h> //printf
#include <string.h> //strcpy
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>
@king-11
king-11 / socket_libraries.md
Last active June 8, 2021 06:20
Comparing Socket Library of different languages

Socket Libraries

  • Julia
  • Go
  • Python

Julia

Julia uses two types of socket structs one is TCPServer other is TCPSocket similarly we also have UDPSocket