Skip to content

Instantly share code, notes, and snippets.

View lynn's full-sized avatar
🐞

Lynn lynn

🐞
View GitHub Profile
@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.
@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).
# 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 / 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│––––––––––––––––│
import random
LONGEST_KEY = 2
STROKE = "KWR*RBG"
def keysmash(alphabet, size):
smash = ["a"] * random.randint(0, 1)
queue = list(alphabet)
for _ in range(size):

About this guide

This is a brief introduction to Lojban, a constructed human language. It has a very nice, fun, regular grammar that computers and humans alike can understand easily.

Basic grammar

All Lojban words are either particles (tiny words that help the grammar) or verbs (which tell us how nouns relate).

A Lojban sentence consists of a main verb with a bunch of nouns plugged into it.

A Lojban verb definition looks like this:

@lynn
lynn / hm.hs
Last active July 29, 2023 13:48
A Haskell implementation of Hindley–Milner (including unification) using STRefs
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
import Control.Monad
import Control.Monad.Except
@lynn
lynn / lojban.md
Last active July 19, 2023 19:53
The Lojban I speak

The Lojban I speak

by la lalxu (Lynn)

This is a list of ways in which my dialect of Lojban differs from the dialect described in The Complete Lojban Language. Most people on the #lojban IRC channel seem to accept and use most of these changes, as well.

The sections marked with an asterisk are approved as part of “base Lojban” by the BPFK (through a voting process). The other sections are simply unofficial additions that people (including me) like enough to use in daily conversation, because they make the language nicer and simpler.

Morphology

Glides*

In CLL Lojban, cmevla and fu'ivla are allowed to contain consonant-glide-vowel sequences like in kuin (Queen). Because it wasn’t clear where it was a good idea to allow them, the BPFK banned them everywhere! Now you can’t have a glide immediately after a consonant anymore, and you need to insert a vowel, writing kuuín (Ku-ween).

@lynn
lynn / uxn_animation.py
Created October 5, 2022 19:36
Makes an animated GIF explaining the uxn sprite format
from PIL import Image, ImageDraw
sprite_data = bytes.fromhex('''
00 00 3c 06 1c 06 3c 00 00 7f c3 f9 e3 f9 c3 ff
00 00 68 2c 78 2c 34 00 00 fe ff ff ff ff ff ff
00 01 19 07 0f 1f 07 0f ff ff e7 fb fd fe ff ff
00 80 f0 e0 c0 f0 f8 f8 ff ff ff ff ff ff 7f 7f
0f 0e 0c 00 80 ff ff 7f ff ff ff ff 7f 00 00 00
e8 e0 e0 60 01 ff ff fe 7f ff ff ff fe 00 00 00
''')
@lynn
lynn / cassini.lean
Created September 24, 2022 22:19
Proof of Cassini's identity in Lean 3
import data.nat.fib
import data.matrix.basic
import data.matrix.notation
import linear_algebra.matrix.determinant
theorem matrix.map_pow {m α β : Type*} [fintype m] [decidable_eq m] [semiring α]
{M : matrix m m α} {n : ℕ} [semiring β] {f : α →+* β} :
(M ^ n).map ⇑f = (M.map ⇑f) ^ n :=
begin
induction n,