Today I stumbled across a jj cheat sheet and it contained an absolute gem of a command that I had somehow completely avoided knowing about this entire time:
jj config edit --user
. You can just run a jj command to open the config file in your editor! You don’t have to remember whether you put it in~/.jjconfig.toml
, or~/.config/jj/config.toml
, or whatever, you can just edit it! Super great.Today I was trying to figure out how to parse a string into an array in zsh, and eventually found the zsh cheat sheet. This should definitely be posted somewhere much easier to find, or maybe should just be the beginning of the zsh man page.
I’m a longtime user of
jq
, but its language is… not intuitive to me. I spent a lot of time searching for prewritten jq programs I can use, or reading the docs trying to figure out the exact thing that I want to do. Mostly, I think to myself “why do I have to learn a new language to manipulate JSON” every time I use it, even if my use is successful and does the thing I want.Good news, you don’t have to learn a new language to filter JSON anymore, thanks to
fx
. With a docs site at the excellent domain fx.wtf, and the ability to filter interactively or by providing Javascript as arguments, fx is the program I have always wished that jq was.One of the sillier things I do with my computer is print a horse fortune every time I open a new shell, printed by the even sillier CLI tool ponysay. A long time ago, I downloaded a fortune database from horsefortun.es (RIP), a website full of posts by the Twitter (RIP) account @horseebooks (RIP). More recently, I added a fortune file of posts from “weird twitter”, which added a lot of excellent variety. Most recently, I added one more, of posts by the excellent @utilitylimb. Most famous for “I can control any kind of gem with any kind of snake”, she is not only an all-time poster, she has returned to the internet after a decade long hiatus and can be found at @utilitylimb.bsky.social. Go and follow.
Anyway, please enjoy these Homebrew formulas for fortune files filled with good weird posts.
brew install indirect/tap/horse_fortunes indirect/tap/weird_fortunes indirect/tap/utilitylimb_fortunes
I use them by putting this at the top of my
.zshrc
:fortune /opt/homebrew/share/games/fortunes/weird | ponysay -b unicode
Apple released developer beta versions of all their OSes this week, and in the past I’ve sometimes upgraded my laptop to the developer betas while reserving my desktop/server to run the final releases. The problem with that plan is if there’s a bad bug in the beta, your laptop doesn’t work anymore. 🥲
I ran across a very cool solution for this problem in a post on bluesky (sorry I can’t find it anymore, whoever posted the link!). VirtualBuddy is a GUI app that wraps the macOS built-in Virtualization.framework to make it super easy to run macOS VMs on top of macOS. If you have a developer account, it’s literally only three clicks to get a macOS beta VM up and running, which is extremely cool.
Today I ran
hugo new
to create a file, and then wanted to edit it. I havefzf
set up to let me open files in Vim, but suddenly realized… why doesn’t the file I just created show up as the first option infzf
? Apparently the answer is that it’s really annoying to get a recursive list of files and then sort them by creation date, to the point where [a Reddit post asking my exact question] had no answers.It took a while to dig around in various different tools’ docs and repos, but I eventually landed on using
rg
to list files. This does exactly what I wanted, and I’m really happy with it:FZF_DEFAULT_COMMAND='rg --files --sortr created' fzf --tmux --print0 | xargs -0 -o $EDITOR
Here’s a breakdown:
rg --files
is how you askripgrep
to list all files in the current directory, recursively (likefind . -type f
, but also respecting.gitignore
)--sortr created
is how you tellripgrep
that it should take every single file it finds and reverse-sort the full list by creation date (that’s how the newest file is the first result insidefzf
)--print0
make sure that fzf will escape file boundaries with a null, in case of special characters in the file name and/or multiple files selectedxargs -0 -o
not only tells xargs to use null separators, but the-o
is a non-POSIX BSD extension (so it’s in macOS as well) that tells xargs to reopen stdin as /dev/tty inside the process it’s about to run. that makes it possible to interact with the editor, if you use a CLI editor
I stumbled across neal.fun’s Internet Artifacts site today and immediately spent an hour interacting with the artifacts. The biggest standouts for me weren’t the websites I remembered from back then, but instead the ones that I don’t remember at all. Even though I was theoretically there at the time, I never really interacted with Ishkur’s guide to electronic music, Club Penguin, or The Impossible Quiz. Making historical websites partly alive again is a great framing.