Skip to content

Instantly share code, notes, and snippets.

View lynn's full-sized avatar
🐞

Lynn lynn

🐞
View GitHub Profile
@lynn
lynn / mod1.c
Last active March 15, 2020 15:54
#include <stdint.h>
#include <stdio.h>
typedef float f32;
typedef int32_t i32;
f32 mod1(f32 f) {
i32 i = *(i32*)&f;
i32 e = (i >> 23) & 0xff;
i32 m = i & 0x7fffff;
@lynn
lynn / now-i-am-an-arsonist
Last active February 21, 2024 11:46
"Now I Am An Arsonist" by Jonathan Coulton (feat. Suzanne Vega) chords for soprano ukulele
"Now I Am An Arsonist"
by Jonathan Coulton (feat. Suzanne Vega)
chords for soprano ukulele
Capo on 1st fret, or tune up a semitone to G# C# E# A#.
────────────────────────────────────────────────────────
Pattern 1 (C lydian)
A│––––––––––––––––│
# To use this, you need Python 3.5+ and pip.
#
# 1. Make a new Discord app with a bot. https://discordapp.com/developers/applications/
#
# 2. Set environment variable SIMPLEWORDS_TOKEN on your computer to the bot's Token.
# Unix/Mac: export SIMPLEWORDS_TOKEN=MzABCDefghIJKLmnopQRSTuv.EnZ3kg.b5bdD74CKCr3du679hkemGJ7R7N
# PowerShell: $env:SIMPLEWORDS_TOKEN='MzABCDefghIJKLmnopQRSTuv.EnZ3kg.b5bdD74CKCr3du679hkemGJ7R7N'
#
# 3. Invite the bot to your server: https://stackoverflow.com/a/37743722/257418
#
@lynn
lynn / ji.py
Last active February 21, 2024 11:46
play just-intonation chord progressions in your terminal
#!/usr/bin/env python
#
# python3.8 ji.py --help
# python3.8 ji.py CEGBb CE-GBbL | aplay -r44 -f S16_LE
# python3.8 ji.py CEGBb CE-GBbL | ffmpeg -f s16le -ar 44.1k -ac 1 -i - ji.mp3
"""
Play chord progressions in just intonation.
Raw PCM audio is written to stdout (signed, 16-bit, LE, mono).
@lynn
lynn / ji.py
Created December 26, 2019 03:52
#!/usr/bin/env python
#
# Listen to justly-tuned progressions.
#
# python3.8 ji.py 1+5:4+7:4 1+4:3+5:3 1+5:4+6:4 1+5:4+7:5 3:4+9:8+4:3 1:2+3:4+5:4 | aplay -r44 -f S16_LE
# python3.8 ji.py 1+5:4+3:2 15:16+9:8+3:2 1+5:4+3:2 | ffmpeg -f s16le -ar 44.1k -ac 1 -i - out.mp3
#
import struct
import sys
@lynn
lynn / lynnglish.md
Last active February 21, 2024 11:46
lynn's internet english idiolect

lynn's internet english idiolect

I wanted to write this little document explaining how "the English I use on the Internet" differs from the English you might read in a newspaper.

I should note: these rules apply in a "direct messaging" or "chatroom" kind of scenario, and also on Twitter. Elsewhere, especially in long-form forum-style environments where I have paragraphs and Markdown, I tend to tone it down. I'll still use emoticons and abbreviations, but try to capitalize and punctuate in a standard way. (This seems kind of common when I compare, say, StackExchange posts versus chatrooms: plenty of members capitalize in the former but not the latter.)

capitalization and punctuation

  • Sentences don't start with a capital letter.
  • I almost always capitalize the word I, because I think it looks weird otherwise. I sometimes lowercase it for effect, as sort of a "hushed voice" thing.
// ==UserScript==
// @name annotate twitter usernames
// @namespace https://twitter.com/chordbug
// @version 0.1
// @description annotate twitter usernames
// @author lynn
// @match https://twitter.com/*
// @grant GM_addStyle
// ==/UserScript==
@lynn
lynn / patch-deinflect.py
Last active February 21, 2024 11:47
Inject rules into the rikaichan/rikaikun `deinflect.dat` file
# usage: python patch-deinflect.py
# (reads deinflect.dat in same folder, writes to new-deinflect.dat)
import fileinput
# Bitmask values
CONJ_RU_VERB = 0x0001
CONJ_U_VERB = 0x0002
CONJ_I_ADJ = 0x0004
@lynn
lynn / deinflect.dat
Created May 5, 2019 21:40
rikaikun deinflect file. Put in "%LOCALAPPDATA%\Google\Chrome\User Data\Default\Extensions\jipdnfibhldikgcjhfnomkfpcebammhp\0.9.1_0\data" or similar.
Deinflect Rules 20081220-0509 | by Jonathan Zarate | http://www.polarcloud.com
polite past negative
polite negative
polite volitional
-chau
-sugiru
-nasai
polite past
-tara
-tari
This file has been truncated, but you can view the full file.
100106029 !!WHOLE_CORPUS !!ANY 4124
6187267 the at0 4120
2941444 of prf 4108
2682863 and cjc 4120
2126369 a at0 4113
1812609 in prp 4109
1620850 to to0 4115
1089186 it pnp 4097
998389 is vbz 4097
923948 was vbd 4005