Skip to content

Instantly share code, notes, and snippets.

View aolkin's full-sized avatar

Aaron Olkin aolkin

View GitHub Profile
@aolkin
aolkin / dndbeyond-source-filter.user.js
Created March 2, 2024 09:50
Filter D&D Beypnd by Owned Sources
// ==UserScript==
// @name D&D Beyond Source Filter
// @namespace https://www.dndbeyond.com/
// @version 2024-03-02
// @description Filter D&D Beypnd by owned sources
// @author aolkin@
// @match https://www.dndbeyond.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=dndbeyond.com
// @grant none
// @run-at context-menu
@aolkin
aolkin / touchosc-decode.py
Last active April 1, 2024 03:19
Convert TouchOSC layouts to and from raw XML
#!/usr/bin/env python3
import sys, zipfile, base64
import xml.etree.ElementTree, xml.dom.minidom
z = zipfile.ZipFile(sys.argv[1])
f = z.open("index.xml")
tree = xml.etree.ElementTree.parse(f)
root = tree.getroot()
@aolkin
aolkin / Melexis MLX90614.md
Last active April 1, 2024 02:13
Quick library to read from the MLX90614 with python on a Raspberry Pi, using the Adafruit_I2C library

Note that the following code must be run at every boot for this to work, because of the repeated-start requirement:

sudo su -c 'echo "Y" > /sys/module/i2c_bcm2708/parameters/combined'

#!/usr/bin/env python3
import random, string, sys
FREQUENCIES = {'L': 7253, 'G': 3693, 'P': 3316, 'M': 4761, 'K': 1257, 'A': 14810, 'R': 10977, 'I': 13318, 'F': 4200, 'Y': 3853, 'T': 16587, 'H': 10795, 'C': 4943, 'X': 315, 'J': 188, 'B': 2715, 'V': 2019, 'O': 14003, 'D': 7874, 'Z': 128, 'W': 3819, 'N': 12666, 'U': 5246, 'Q': 205, 'S': 11450, 'E': 21912}
VOWELS = "aeiou"
SINGLES = "aI"
DOUBLES = "lseotfprmcndgb"
ENDS = "etds"