Skip to content

Instantly share code, notes, and snippets.

View xadn's full-sized avatar

Andy Niccolai xadn

View GitHub Profile
@xadn
xadn / cleanup-gammas.md
Created March 13, 2026 18:08
Claude Code command: Trash all unstarred gammas on the dashboard via browser automation
description Trash all unstarred gammas on the current dashboard page using browser automation. Use when asked to "clean up gammas", "trash unstarred", "delete unstarred gammas", or "clean dashboard".
allowed-tools
mcp__claude-in-chrome__tabs_context_mcp
mcp__claude-in-chrome__javascript_tool
mcp__claude-in-chrome__read_console_messages

Cleanup Unstarred Gammas

@xadn
xadn / SKILL.md
Created March 13, 2026 18:08
Claude Code skill: Edit GIF files with gifsicle for PR demos
name gif-edit
description Edit GIF files with gifsicle for PR demos. Replicate frames, delete frames, adjust timing, set looping, and more. Use when asked to "edit a gif", "slow down a gif", "hold on a frame", "fix gif timing", or optimize recorded demo GIFs.
args (optional) path to GIF file and/or editing instructions

GIF Edit

Edit GIF files using gifsicle for polishing PR demo recordings.

@xadn
xadn / SKILL.md
Last active March 13, 2026 18:10
Claude Code skill: Record browser interactions as demo GIFs for PR demos
name demo-gif
description Record concise demo GIFs for feature branches using browser automation. Use when asked to "record a demo", "make a gif", "capture the feature", "show the PR in action", or demonstrate UI changes for pull requests.

Demo GIF

Record browser interactions as GIF for PR demos using chrome-devtools MCP.

Workflow (Sequential - Do Not Skip Steps)

@xadn
xadn / pr-view-hook-gist.md
Created February 25, 2026 07:59
Claude Code hook: force read-before-edit on PRs

Force Claude Code to read before editing PRs

Claude Code likes to gh pr edit PRs without reading the current state first — overwriting descriptions, losing context, or making changes based on stale assumptions. This hook pair forces a "read before write" pattern: any gh pr edit is blocked unless gh pr view was called first for that PR in the same session.

How it works

Two hooks — a PostToolUse hook records when Claude views a PR, and a PreToolUse hook blocks edits unless a view was recorded. The view is consumed after each edit, so consecutive edits each require a fresh read.

gh pr view 123 ...   →  records "123" to a temp file
@xadn
xadn / stamp_example.rb
Created October 24, 2012 16:43
stamp example
date = Date.new(2011, 6, 9)
date.stamp("March 1, 1999") #=> "June 9, 2011"
date.stamp("Jan 1, 1999") #=> "Jun 9, 2011"
date.stamp("Jan 01") #=> "Jun 09"
date.stamp("Sunday, May 1, 2000") #=> "Thursday, June 9, 2011"
date.stamp("Sun Aug 5") #=> "Thu Jun 9"
date.stamp("12/31/99") #=> "06/09/11"
date.stamp("DOB: 12/31/2000") #=> "DOB: 06/09/2011"
@xadn
xadn / address conversion
Created February 27, 2011 21:03
Ruby zero pad a number and convert it to binary
# add leading zeros to a number
def zero_pad(target_length, input_string)
pad_length = target_length - input_string.length
"0" * pad_length + input
end
# convert a number to binary
@xadn
xadn / comments clean up
Created February 27, 2011 20:56
Ruby regex for stripping comments and whitespace
# Remove comments, whitespace, newlines, and returns
# Use line.gsub! to modify the actual line instead of just returning the result
@input = line.gsub(/\t|\s|\n|\r|\/{2}.*$/, '')
# Then, once all of the crap is gone make sure to skip empty lines
if(!@input.empty?)