Skip to content

Instantly share code, notes, and snippets.

@dunhamsteve
dunhamsteve / sw_cache
Last active April 20, 2023 21:46
Scans the chrome service worker caches and prints url and size for each directory
#!/usr/bin/env python3
# Scans the chrome service worker caches and prints url and size for each directory
# Add -v to the command line for more details
import struct, os, functools, sys
def uvarint(data,pos):
x = s = 0
while True:
from yaml import Loader, load
# I got the idea from:
# https://github.com/Granitosaurus/macos-compose/tree/master
# in Karabiner, assign right_control to non_us_backslash (which somehow is §)
#
# in keys.yaml, lines like:
# §to: →
# §in: ∈
# §ni: ∋
# §all: ∀
@dunhamsteve
dunhamsteve / zoo2.ts
Created November 20, 2023 04:02
Normalization by evaluation in typescript
// Normalization by evaluation
//
// I was playing around with mogensen-scott encoding of the STLC and got carried away.
//
// Inspired Andras Kovacs' by elaboration-zoo typecheck-HOAS-names
//
// By inspired, I mean that I wrote this after studing Kovacs' stuff and then
// cheated and looked up some of the answers when I got to the infer/check bit.
// Any bugs are mine, though.