I write code in the evenings and on weekends. Mostly Go and shell, sometimes a little Rust when I am feeling brave. This is where I take notes so I can find them again later.
Why I moved my dotfiles to chezmoi
I have been hand-rolling a dotfiles repo since roughly 2014. The recipe was always the same: a folder full of .zshrc and .gitconfig and friends, plus an install.sh that ran a few dozen ln -sf lines. It worked. It also broke in slightly different ways every time I set up a new machine. A few months ago I gave chezmoi a real try and now I do not understand why I waited so long. What it gets right: ...
A Go CLI starter template I keep reusing
Every few months I find myself reaching for the same handful of patterns when I start a new Go CLI. This time I finally wrote them down in a tiny template I can clone and fill in. Nothing here is novel, but having it sitting in one place saves me 30 minutes of plumbing each time. The layout I converged on: . ├── cmd/<binary>/main.go // entry point, only flag parsing and wiring ├── internal/app/ // the actual logic ├── internal/cli/ // flag definitions, help text ├── internal/version/ // baked-in build info ├── Makefile └── go.mod The pieces I always end up needing: ...
Switching from Vim to Helix after twelve years
I have been using Vim since 2013. Last month I gave Helix a real try, the kind where you delete the symlink to nvim and force yourself to use the new thing for two weeks. I do not think I am going back. The selling point for me is not the modal model or the speed. It is the fact that Helix ships with a working LSP and tree-sitter setup out of the box and I never had to think about it. My Neovim config was 800 lines of Lua and broke approximately every other month when a plugin author rewrote their API. The Helix config that does roughly the same thing is 40 lines of TOML and has not broken once. ...
A tiny zsh function I use daily
This is silly but it has paid for itself many times over. I added it to my .zshrc years ago and I now reach for it five or six times a day without thinking. mkcd() { mkdir -p "$1" && cd "$1" } That is the whole thing. mkcd some/nested/path creates the directory and steps into it in one motion. I know mkdir -p && cd is two words longer, but those two words turn out to be the difference between flow and friction. ...
Notes on rsync incremental backups
I have been using a small rsync script to back up my laptop to an old USB drive every Sunday evening for the past three years. It is nothing fancy, but I keep tweaking it and I figured I should write down what it actually does before I forget. The core idea is --link-dest: each weekly snapshot only stores files that changed since the previous one, and everything else is a hardlink to the prior snapshot. On disk it looks like a full copy of every backup, but the space cost is roughly one full copy plus the deltas. ...