Skip to content

Instantly share code, notes, and snippets.

View stefanv's full-sized avatar

Stefan van der Walt stefanv

View GitHub Profile
@stefanv
stefanv / gist:16c765cea344a2754f2ac01a2f405fc1
Created October 13, 2026 00:15
Hold the Night — Scrimshaw Jukebox song
title Hold the Night
composer Claude Opus 5.5
about A rock ballad for the last stand on the castle walls. Chugging power chords, eighth-note bass, a saw-lead solo and a key change into the final chorus.
tempo 130
beats 4 # 4 beats per bar
steps 2 # eighth notes: 8 steps per bar
swing 0
reverb 0.4
voice lead saw vol=0.85 rev=0.35 bright=1.1 att=0.01 rel=0.25 glide=0.06
@stefanv
stefanv / si2.mjs
Created March 20, 2026 23:02
si2 role for myst
const UNITS = {
// SI base units
ampere: 'A',
candela: 'cd',
kelvin: 'K',
kilogram: 'kg',
metre: 'm',
meter: 'm',
mole: 'mol',
second: 's',
@stefanv
stefanv / bubble-run
Last active March 12, 2026 18:11
Bubble wrapper for claude / gemini
See https://github.com/stefanv/agent-cli-bubblewrap
@stefanv
stefanv / omnivore-to-wallabag.py
Created October 31, 2024 18:57
Import Omnivore reading list into Wallabag
"""Convert exported Omnivore reading list to Wallabag v2 JSON format.
This is by no means well checked or perfect, but it should serve as a start for further efforts.
It got my list of articles imported into Wallabag, which is all I wanted.
"""
import json
import csv
from datetime import datetime
import glob
@stefanv
stefanv / org-gh-links.el
Created January 20, 2024 22:02
GitHub links for org mode
@stefanv
stefanv / install-deps
Last active November 4, 2023 21:45
Install build or other dependencies from pyproject.toml
#!/usr/bin/env python
import tomllib
import argparse
import sys
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument(
import numpy as np
from skimage.transform import warp, PolynomialTransform
from skimage import data
import matplotlib.pyplot as plt
def swirl(xy, x0, y0, R):
r = np.sqrt((xy[:,1]-x0)**2 + (xy[:,0]-y0)**2)
a = np.pi*r / R
xy = np.copy(xy)
xy[:, 1], xy[:, 0] = (

Typing Guidance for Python Libraries

Much of Python’s popularity can be attributed to the rich collection of Python libraries available to developers. Authors of these libraries play an important role in improving the experience for Python developers. This document provides some recommendations and guidance for Python library authors.

These recommendations are intended to provide the following benefits:

@stefanv
stefanv / http_server_python
Last active June 3, 2026 17:34
Multi-threaded HTTP server in Python
#!/usr/bin/env python3
# See https://github.com/Nakiami/MultithreadedSimpleHTTPServer/blob/master/MultithreadedSimpleHTTPServer.py
# Python 3.x
from socketserver import ThreadingMixIn
from http.server import SimpleHTTPRequestHandler, HTTPServer
class ThreadingSimpleServer(ThreadingMixIn, HTTPServer):
pass