Skip to content

Instantly share code, notes, and snippets.

View kmein's full-sized avatar
🦀
computering hard

Kierán Meinhardt kmein

🦀
computering hard
View GitHub Profile
@kmein
kmein / spotify-archive.ts
Created October 24, 2023 17:57
Script to archive your Spotify playlists
import { Base64 } from "https://deno.land/x/bb64/mod.ts";
import { join } from "https://deno.land/std/path/mod.ts";
import { exists } from "https://deno.land/std/fs/mod.ts";
const debug = (x: T): T => {
console.error(x);
return x;
};
const assertEnv = (key: string): string => {
def infix(tree):
if type(tree) == int:
return str(tree)
elif len(tree) == 3:
t1, op, t2 = tree
return "({} {} {})".format(infix(t1), op, infix(t2))
else:
raise ValueError("Malformed expression tree.")
@kmein
kmein / skandieren.sed
Created February 5, 2017 16:12
sed script for automated metrical analysis of latin texts
s/\(.*\)/\L\1/g
s/[^a-z ]//g
s/\s\+/ /g
s/^ //g
# i initiale
s/\bi\([aeouy]\)/j\1/g
# synizesis / synalloephe
s/\([aeiou]m\?\) est/\1st/g