Skip to content

Instantly share code, notes, and snippets.

View ktemkin's full-sized avatar

Kate Temkin ktemkin

View GitHub Profile
@ktemkin
ktemkin / README.md
Last active May 26, 2025 05:58
script to grab garmin maps from Express without waiting for them to transfer

Proof I'm Terminally Impatient

Tired of waiting for Garmin to transfer those map files to your GPS over its incredible 12Mbps full speed USB? Tired of waiting for two hours for it to copy, only for the cable to be jostled just enough for it to fail early -- and then you're stuck with a bunch of map files but none of the gods-forsaken unlock codes that you need to use them?

Well, I am, and since this is my README, you don't get to judge me. That's just the way it is.

Usage

  • Start Garmin Express, and tell it to download the target maps to your device.
  • Wait for the message to change from "downloading files" to "copying files".
@ktemkin
ktemkin / quote-for-nixos.xsh
Created May 3, 2024 14:52
hack to let you use unquoted flake attr refs in xonsh
""" Input transformer that automatically quotes mid-word #s for e.g. nix. """
from xonsh.events import events
@events.on_transform_command
def _autoquote_for_nix(cmd):
new_command = []
# Process each word individually.
words = cmd.strip().split(" ")
#!/usr/bin/env python2.7
import asyncore
import evdev
import signal
import re
#Stores the product names for each device which can be used as a vim-clutch.
COMPATIBLE_NAME_REGEX = "RDing FootSwitch.*";
@ktemkin
ktemkin / maschine_mk3.md
Created May 18, 2023 00:26
Maschine Mk3 RE Notes

Display Format

The device has a "vendor defined interface" (5) with a single bulk OUT endpoint (4). This accepts commands that will set the screen value, with the following format:

Byte Meaning
0 const 0x84, command
1 const 0x00
2 screen number; 0 for left, 1 for right
3 const 0x60
@ktemkin
ktemkin / roli_fw_extract.py
Created April 29, 2023 07:03
WIP script to unpack Roli firmware files
#!/usr/bin/python3
import math
import mido
FIRMWARE_IN = "firmware.syx"
FIRMWARE_OUT = "firmware.bin"
FIRMWARE_PUSH_COMMAND = 0x04
@ktemkin
ktemkin / default.nix
Last active August 23, 2024 17:38
scopehal derivation + dependencies
#
# scopehal apps, including glscopeclient and optionally ngscopeclient
#
# vim: et:ts=2:sw=2:
#
{ pkgs, lib, cmake, pkg-config, patchelf, ... }:
let
ffts = (pkgs.callPackage ./ffts.nix { });
vulkan-sdk = (pkgs.callPackage ./vulkan-sdk.nix { });
in
@ktemkin
ktemkin / set_gerrit_font.js
Last active November 11, 2021 06:25
user script body to set Gerrit fonts
// ==UserScript==
// @name Gerrit Fonts
// @namespace https://gerrit.YOURDOMAINHERE.com
// @match https://gerrit.YOURDOMAINHERE.com/*
// ==/UserScript==
'use strict';
(function() {
-- Get the basic systems we'll want to work with.
player = Game.GetPlayer()
scriptables = Game.GetScriptableSystemsContainer()
transaction = Game.GetTransactionSystem()
equipment = scriptables:Get(CName.new("EquipmentSystem"))
-- Get data for the player.
player_data = equipment:GetPlayerData(player)
-- Hack: we need the second internal entry with the same name; so we'll create our own entry pointing to the new function.
@ktemkin
ktemkin / lamp-control.py
Created November 18, 2020 00:24
Working mockup for controlling a JOOFOO lamp with the YS1.
#!/usr/bin/env python3
"""
Silly YS1 mockup of an interface for the JOOFOO remote-controlled lamp.
"""
import sys
import argparse
# Normally, we'd just import *, but rfcat likes to do things like export functions called str(),
# so we'll be a bit more selective.
#!/usr/bin/env python2.7
# public domain-y, Kate Temkin, 2015
import asyncore
import evdev
import signal
import re
#Stores the product names for each device which can be used as a vim-clutch.
COMPATIBLE_NAME_REGEX = "RDing FootSwitch.*";