Skip to content

Instantly share code, notes, and snippets.

@umputun
umputun / plan-annotate.py
Created February 15, 2026 18:27
plan-annotate.py - Claude Code hook for interactive plan review via kitty overlay editor
#!/usr/bin/env python3
"""plan-annotate.py - PreToolUse hook for ExitPlanMode.
interactive plan review hook that lets you annotate Claude's plans directly
in your editor before approving them. when Claude calls ExitPlanMode, this
hook intercepts the call, opens the plan in $EDITOR via a kitty terminal
overlay, and waits for you to review/edit. if you make changes, the hook
computes a unified diff and sends it back to Claude as a denial reason,
forcing Claude to revise the plan based on your annotations. if you make
no changes, the normal approval dialog appears.
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active January 20, 2026 13:32
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@oriolgual
oriolgual / application_controller.rb
Created March 9, 2017 10:07
Example LogRage & Rails configuration
def append_info_to_payload(payload)
super
payload[:remote_ip] = request.remote_ip
payload[:user_id] = current_user.try(:id)
payload[:organization_id] = current_organization.try(:id)
payload[:app] = current_organization.name
payload[:referer] = request.referer.to_s
payload[:request_id] = request.uuid
payload[:user_agent] = request.user_agent
payload[:xhr] = request.xhr? ? 'true' : 'false'

The Complete Guide to Nested Forms in Phoenix

I recently spent some time dealing with nested forms in Phoenix. Nested forms are great when you want to create multiple database records in a single transaction and associate them with each other. I am new to Phoenix and really struggled to find any resources that helped me with my specific problem. I decided to document what I learned in the process in hopes of helping others that are new to Elixir and Phoenix.

Here is my attempt at a one stop shop to learn everything you will need to know about nested forms. If you would like to view the GitHub repo you can check it out here.

Thanks to Heartbeat and Jose for excellent blog posts on nested forms. Also shoutout to Josh for showing me some examples at Ruby

@mikoim
mikoim / README.md
Last active October 2, 2025 02:55
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@huytd
huytd / .gitconfig
Created August 4, 2016 16:26
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
@palkan
palkan / gist:d89757a90cfbeb047c63
Last active January 27, 2025 07:25
Rails debug cheat sheet

Setup

Replace IRB with Pry (in your Gemfile) and Byebug with pry-byebug.

gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]

Using PRY

@palkan
palkan / rubocop_pre_commit_hook
Last active June 19, 2024 10:41 — forked from mpeteuil/rubocop_pre_commit_hook
Rubocop pre-commit hook
#!/usr/bin/env ruby
ADDED_OR_MODIFIED = /^\s*(A|AM|M)/.freeze
changed_files = `git status --porcelain`.split(/\n/)
unstaged_files = `git ls-files -m`.split(/\n/)
changed_files = changed_files.select { |f| f =~ ADDED_OR_MODIFIED }
changed_files = changed_files.map { |f| f.split(" ")[1] }