Will Murphy's personal home page

Will's Picks

These are things that I recommend or like in some way. They' too short or underdeveloped for a whole blog post, but I hope you'll check them out.

Rustlings: my favorite tiny-broken-program teaching tool

There are lots of tools that are shaped like, “learn language X by fixing tiny broken programs that are written in X.” Rustlings is my favorite. (Some other examples are Ruby Koans, Lua Missions, Ziglings.)

Here are some things that are great about Rustlings:

  1. It has a cool little watcher program that runs the next test and shows a progress bar. (I am highly motivated by made-up internet points, so having a progress bar was highly motivating.)
  2. The little watcher program handles re-running tests, which saved me typing typing “up arrow, up arrow, enter” to see if my solution was right 1 million times.
  3. There little watcher program has “hint” and “reset” buttons.
  4. It’s not really Rustlings fault specifically, but the careful attention to error messages in the Rust ecosystem made the whole process fun.

So my pick today is: Go try Rustlings! If come for the Rust, stay for the cute little TUI that guides you through.

git alias for diff similar to what GitHub shows

Use this to show what was added by a branch

This command shows what’s added to a project by the current branch, ignoring changes to origin/main since the current branch diverged. I think this is basically what is shown on PRs in GitHub:

git diff $(git merge-base origin/main HEAD)..HEAD

I find this a bit much to type, so I’ve added the git alias bdiff (for “branch diff”) like so:

git config --global alias.bdiff '!f() { git diff $(git merge-base HEAD origin/main) HEAD "$@"; }; f'