Welcome to my blog where I write about things that interest me, stuff that was hard to figure out, and sometimes just to show off. I hope you find something interesting.

Recent Blog Posts

zsh Autocompletion Caveat

23 Aug 2019 , tagged: zsh, Go, Golang

I spent a good hour trying to get a custom completion script working while porting my app Harbormaster to Cobra. It would and would not work. I retried writing the file, restarting the shell and it would just not offer any completions. Eventually I stumbled upon a innocent looking post on Github that held the solution: remove the .zcompdump file which holds the cached completions. So I ran rm ~/.zcompdump && compinit and everything works as expected.

read more →

awk Cheat Sheet

26 Mar 2019 , tagged: awk, unix, cheat sheet

I needed to crunch some data quickly and decided awk was the right tool to do so. But every time I use awk, I have to go read the manual, so I decided it’s time for a cheat sheet. Structure of an awk script # Comments begin with a pound sign BEGIN { # Instructions run before the main loop FS = ";" # Set a Field Separator } # Each line of input is applied against all the following # regular expressions and runs the instructions in the # block: /^$/ { print "An empty line" } END { # Instructions run after the main loop } Invoke awk with a script like so:

read more →

Book Arrival: The Ray Tracer Challenge

24 Mar 2019 , tagged: Books, Ray Tracer, Rust, Cucumber, Test Driven Development

I was browsing the Pragmatic Bookshelf and this book caught my eye: writing a ray tracer from ground up with a test driven approach? This sounds like a fantastic challenge to me. I always was interested in ray tracers but always thought it too complicated a topic to do it myself. However, test driven development has helped me work on some complex and terrible code bases, so this feels reassuring to me.

read more →