Skip to content

Instantly share code, notes, and snippets.

View walfie's full-sized avatar

walfie

  • New York City
  • 06:12 (UTC -04:00)
View GitHub Profile
@walfie
walfie / strudel-roman-chords-extended.js
Created March 16, 2026 00:49
Roman chord notation in Strudel, including secondary chords
const romanNumerals = ['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii'];
function romanToIndex(s) {
for (let index = romanNumerals.length - 1; index >= 0; index--) {
const numeral = romanNumerals[index];
if (s.startsWith(numeral)) {
return { index, isMinor: true, suffix: s.substring(numeral.length) };
} else if (s.startsWith(numeral.toUpperCase())) {
return { index, isMinor: false, suffix: s.substring(numeral.length) };
}
}
@walfie
walfie / strudel-roman-chords.js
Last active March 15, 2026 03:59
Roman notation chords in Strudel
const romanChordMapping = { i: 0, ii: 1, iii: 2, iv: 3, v: 4, vi: 5, vii: 6 }
register('romanChord', function (scaleName, pat) {
return pat.as("roman:chordSuffix").fmap(({ roman, chordSuffix}) => {
const lower = roman.toLowerCase();
return n(romanChordMapping[lower]).scale(scaleName).fmap(value => {
return value.note.slice(0, -1) + (roman == lower ? 'm' : '') + (chordSuffix || '');
}).chord();
}).outerJoin();
});
@walfie
walfie / flake.nix
Last active September 17, 2022 20:32
nix flake devshell
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?rev=d9a1414346059619d9e13ab93e749bbb82e5252a";
};
outputs = inputs @ { nixpkgs, ... }:
let
system = "x86_64-darwin";
pkgs = import nixpkgs { inherit system; };
@import url("https://fonts.googleapis.com/css?family=Noto Sans");
/* Background colors*/
body {
overflow: hidden;
background-color: rgba(0,0,0,0);
}
/* Transparent background. */
yt-live-chat-renderer {
background-color: transparent !important;
@walfie
walfie / make-gif-from-frames.sh
Last active October 16, 2021 05:28
My process of turning a Callipeg export of PNG frames into gifs and spritesheets
export NAME="my-animation"
export WIDTH=815
export HEIGHT=950
export BG_COLOR="#d1ccff"
export SPRITESHEET_SIZE=5x3
export TINIFY_API_KEY="..."
# Assuming frames have been exported to `~/Downloads/`...
# Make directories
@walfie
walfie / ac-tune.html
Last active March 7, 2020 22:32
Animal Crossing Tune Player
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Animal Crossing Tune Maker</title>
</head>
<body>
<input id="input" value="g-a-bgab-gab-c-b" maxlength="16"></input>
@walfie
walfie / hide-twitter-stats.user.css
Last active May 31, 2024 00:19
Hide twitter likes/RTs
/* ==UserStyle==
@name Hide Twitter Likes/RTs
@namespace github.com/walfie
@version 1.5.0
@description Hide likes/RTs on Twitter and TweetDeck
@author Walfie
==/UserStyle== */
@-moz-document url-prefix("https://twitter.com/"), url-prefix("https://x.com/"),
url-prefix("https://mobile.twitter.com/"),
@walfie
walfie / twitter_gif_loop.sh
Created April 1, 2018 02:40
gif from png sequence for twitter
# Let's say an animation has frames {1,2,3,4}.png and is 24fps.
# To make it loop nicely on twitter, we want something like:
#
# 1 1 2 2 3 3 4
#
# at 48fps. The below command, using a bunch of hacks, will
# take a PNG sequence and create a gif with the above sequence.
# Note that 2.0833333... is 1/48, e.g., 48fps.
@walfie
walfie / index.html
Last active March 30, 2018 17:54
Lorem Ipsum
<!DOCTYPE html>
<!-- inspired by https://gir.st -->
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1">
<style>
body{max-width:50em;margin:auto;padding:1em;line-height:1.5em}
pre{overflow-x:auto}
</style>
<title>Lorem Ipsum</title>
@walfie
walfie / mediawiki
Last active March 12, 2018 02:35
mediawiki parse article html
parse
https://enterthegungeon.gamepedia.com/api.php?action=parse&format=json&mobileformat=true&prop=text&disableeditsection=true&page=Space_Friend
suggest
https://enterthegungeon.gamepedia.com/api.php?action=opensearch&format=json&formatversion=2&search=a&namespace=0&limit=10&suggest=true