Skip to content

Instantly share code, notes, and snippets.

View jaymcgavren's full-sized avatar

Jay McGavren jaymcgavren

View GitHub Profile
@jaymcgavren
jaymcgavren / super-legally-distinct-pipefitting-bros-log.md
Last active November 6, 2026 03:38
Super Legally Distinct Pipefitting Brothers: wasmcart game Claude Code sessions

Super Legally Distinct Pipefitting Bros: Claude Code sessions

Logs from a series of Claude Code sessions used to create https://github.com/jaymcgavren/super-legally-distinct-pipefitting-bros

Romdev MCP wasmcart game (2026-11-04)

Session: 3ca44e16-d0a7-4c70-9084-01a35a27ab4c
Directory: /Users/jay/work/super-legally-distinct-pipefitting-bros
Started: 2026-11-04T03:17:55.044Z

User (2026-11-03 20:18:13)

@jaymcgavren
jaymcgavren / claudelog.rb
Last active November 6, 2026 00:43
Reconstruct prompts and responses from a Claude chat log
#!/usr/bin/env ruby
# frozen_string_literal: true
# claudelog.rb - reconstruct a Claude Code chat (prompts and responses) from a
# session log.
#
# Claude Code writes one log per session to
# ~/.claude/projects/<mangled-cwd>/<session-id>.jsonl
# Each line is a JSON record. This script also accepts a single JSON array of
# those records.
@jaymcgavren
jaymcgavren / README.md
Last active September 28, 2026 01:36
myfilter.rb: vibe-coded script to use LLM to filter Bluesky and Mastodon timelines

myfilter

Reads your Bluesky and Mastodon home timelines, asks a language model which posts are about topics you'd rather avoid (politics, war, whatever you list), and writes a calm, merged timeline to an HTML page.

  • Works with Claude, a local model (Ollama, LM Studio, llama.cpp and others), or any command-line tool that reads a prompt and prints a reply.
  • Only uses the Ruby standard library (Ruby 3.1 or later).
  • Remembers verdicts, so each post is sent to the model only once.
  • Filtered posts are listed at the bottom of the page by author and topic only, without their content, so you can check for mistakes without reading them.

Setup

@jaymcgavren
jaymcgavren / video_join.rb
Last active September 8, 2026 22:30
A Ruby script that uses ffmpeg to concatenate multiple videos into one
#!/usr/bin/env ruby
# Joins videos end to end into one video, in the order they are given. The new
# video is as long as all of them added together. Nothing is cut.
#
# video_join.rb -i intro.mp4 -i gameplay.mp4 -i outro.mp4 whole.mp4
#
# The videos do not have to match. Each one is made the size, shape and frame
# rate of the first, and a video of a different shape gets black bars rather
# than being stretched. A video with no sound is joined with silence, so the
# sound of the others stays lined up with the picture.
@jaymcgavren
jaymcgavren / video_images.rb
Created September 8, 2026 05:56
A Ruby script that uses ffmpeg to overlay images on a video
#!/usr/bin/env ruby
# Lays one or more images over a video. Each image has its own timing, opacity,
# size and position.
#
# Every --image starts a new overlay. Options before the first --image set the
# defaults for all overlays; options after one apply to that overlay only.
#
# video_images.rb --duration 5 \
# -i logo.png -s 0 -x 1 -y 0 --width 200 \
# -i arrow.png -s 3 -d 2 -o 0.5 -x 0.5 -y 0.75 \
@jaymcgavren
jaymcgavren / video_audio_mix.rb
Created September 8, 2026 05:55
A Ruby script that uses ffmpeg to mix an audio track into a video
#!/usr/bin/env ruby
# Mixes a sound file into the sound of a video. Both are heard at once, and the
# video keeps its own length. The sound file must not be longer than the video.
#
# video_audio_mix.rb -a music.m4a gameplay.mp4
# video_audio_mix.rb -a voice.wav --volume 30 gameplay.mp4 narrated.mp4
#
# Both sounds play at their own volume unless --volume lowers the video's sound
# to make room. If the video has no sound of its own, the file becomes its sound.
#
@jaymcgavren
jaymcgavren / video_crop.rb
Created September 8, 2026 01:13
A Ruby script that uses ffmpeg to crop a source video
#!/usr/bin/env ruby
# Cuts a rectangle out of a video and writes it as a new video of that size.
# The rest of the picture is thrown away; nothing is scaled or stretched.
#
# video_crop.rb --width 1080 --height 1920 wide-recording.mp4
# video_crop.rb -x 100 -y 40 --width 800 --height 600 clip.mp4 corner.mp4
#
# Sizes and positions are in pixels of the source video. x and y are the top
# left corner of the rectangle; leave either one out and the rectangle is
# centred on that axis. Leave a width or a height out and the whole width or
@jaymcgavren
jaymcgavren / video_text.rb
Last active September 8, 2026 05:53
A Ruby script that uses ffmpeg to add one or more text overlays to a video.
#!/usr/bin/env ruby
# Draws one or more text overlays on a video. Each overlay has its own text,
# timing, font, size, alignment and position. Text is white with a black
# outline, and can sit on an optional semi-transparent box.
#
# Every --text starts a new overlay. Options before the first --text set the
# defaults for all overlays; options after one apply to that overlay only.
#
# video_text.rb --font "Pixelify Sans" \
# -t 'New\nGame\nGenie\nCodes' -s 0 -d 2 --box \
@jaymcgavren
jaymcgavren / roaming_watermark.rb
Last active September 7, 2026 23:29
A Ruby script that uses ffmpeg to apply a text watermark at random positions on a video
#!/usr/bin/env ruby
# Adds a roaming watermark to a video: the text appears for a few seconds at a
# random spot, disappears, then comes back somewhere else. A mark that moves is
# harder to crop out than one fixed in a corner.
#
# The video is re-encoded at near-lossless quality; the audio is copied untouched.
require "json"
require "optparse"
require "shellwords"
@jaymcgavren
jaymcgavren / nes_game_genie_english.txt
Last active August 8, 2026 00:35
8-letter English words that can be spelled on a NES Game Genie
ALIENATE
ALKALINE
ALLUSION
ANALYSES
ANALYSIS
ANNOYING
ANNUALLY
ANTELOPE
ANTENNAE
APOPLEXY