Skip to content

Instantly share code, notes, and snippets.

View danielpancake's full-sized avatar
🐣
half boiled egg

Daniel Vakhrushev danielpancake

🐣
half boiled egg
View GitHub Profile
@danielpancake
danielpancake / gm-multikey-dict.gml
Last active October 8, 2025 11:58
Nested dictionary implementation that stores and retrieves values using multiple keys as a hierarchical path
function MultiKeyDict() constructor {
dict = {};
/**
* @desc Stores a value at a specified path. Creates intermediate structs for missing keys.
* Requires at least 2 arguments (1+ keys and 1 value). Non-struct intermediates will be overwritten
*
* @param {String|Any} keys - Sequence of keys followed by the value to store (last argument)
*/
@danielpancake
danielpancake / srt-resync.hs
Created June 12, 2023 13:00
Stretch SRT subtitles
import System.IO
import Data.String
import Data.List
import Data.Text ( splitOn, unpack, pack )
import Text.Printf
main = do
input <- readFile "./input.srt"
writeFile "./output.srt" (unlines (parseInput (lines input)))