Skip to content

Instantly share code, notes, and snippets.

View rsaarelm's full-sized avatar

Risto Saarelma rsaarelm

View GitHub Profile
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "beautifulsoup4>=4.14.3",
# "platformdirs>=4.9.6",
# "requests>=2.34.2",
# ]
# ///
@rsaarelm
rsaarelm / nicoll.js
Created October 23, 2025 06:53
Tampermonkey script to remove "USA delenda est" footnotes from jamesdavisnicoll.com
// ==UserScript==
// @name Footnote delenda est
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Remove "USA delenda est" footnote and corresponding footnote marker
// @match https://jamesdavisnicoll.com/*
// @grant none
// ==/UserScript==
// Set this to 'true' to renumber the remaining footnotes to erase any remaining trace of the
@rsaarelm
rsaarelm / sheets.fish
Last active January 29, 2025 18:11
Ultima 7 Black Gate Shapes extractor
#!/usr/bin/env fish
# Make sprite sheets from the pile of loose pngs produced by u7extract.
set last_number = ""
mkdir -p sheets
for file in *.png
set parts (string split - $file)
#!/usr/bin/env rust-script
//! Ultima 2 dialogue file unscrambler
//!
//! * You must have a working [rust-script](https://rust-script.org/) and the
//! Rust development environment with `rustc` and `cargo` binaries on your
//! path.
//!
//! * Run `u2-tlk tlkx11` to turn scrambled dialogue file to plaintext.
//!
#!/usr/bin/env rust-script
//! Ultima 5 tileset to PNG and back converter.
//!
//! * You must have a working [rust-script](https://rust-script.org/) and the
//! Rust development environment with `rustc` and `cargo` binaries on your
//! path.
//!
//! * Run `u5-tile-convert TILES.16` to produce `TILES.png`
//!
@rsaarelm
rsaarelm / Makefile
Created January 20, 2024 04:03
Roguelike Radio AI autotranscriber
EPS := $(shell seq 1 156)
all: $(patsubst %, transcripts/roguelikeradio%.txt, $(EPS))
transcripts/%.txt: audio/%.mp3
whisper --output_dir transcripts --language en $<
audio/%.mp3:
wget -P audio/ http://www.gamesofgrey.com/roguelikeradio/`basename $@`
clean: