Mac keyboard with hidutil #
[Updated 13-Apr-2023 with some of the background context and some things I learned from hackernews]
On my Mac, I've used KeyRemap4Macbook, Karabiner, Karabiner Elements, and FunctionFlip for some of my key remapping needs. The main things I want:
- On the laptop keyboard, some media keys should be function keys but other media keys should stay media keys. When using fn I want to get the other version of the key.
- On external keyboards, make the function keys act like the laptop keyboard.
- On external keyboards, the numpad should act like "numlock off". For example, 4 should be Left Arrow.
- On external keyboards, the Windows key should act as Option, and the Alt key should act as Command. This can usually be set in the System Preferences. (Except it doesn't work on one of my keyboards)
- I also use those same external keyboards with my Windows and Linux machines, so I prefer to make these changes through software rather than firmware.
Road Archaeology, part 1 #
While on road trips I notice sometimes there are places where a road will deviate from the path I expect it to take. I take a note of it and then investigate what happened there. Usually there's some geography or history involved. Take I-5 in Northern California for example. There's a straight segment from Dunnigan CA to Williams CA:
But let's zoom in a bit, to Arbuckle CA:
I-5 looks like it'd be a straight line, but it bends to the west of town and then goes back to its original line. What's going on?
Interstate freeway I-5 from the 1970s mostly follows California highway CA-99W, which used to be US highway US-99 in the 1920s, which used to be Pacific Highway in the 1910s. That highway followed the Southern Pacific rail line, which used to be the Central Pacific Railroad's line in the late 1800s. And before that, there was the Siskiyou Trail from the early 1800s.
Why "mostly follows"? It's because CA-99 is still there, as is the rail line. The downtown commercial area of Arbuckle is adjacent to the rail line. The town was created in 1875 and the train depot was built in 1876. The commercial buildings were built near the train depot. A century later, when I-5 was built, they moved it several blocks to the west.
Arbuckle isn't the only place like this. Take a look at Williams CA:
Here, I-5 follows a straight line adjacent to CA-99W and the railroad, but then takes a detour to the east. The town of Williams also started because of the railroad, back in the 1870s. The freeway goes around the commercial district that would've started adjacent to the railroad.
You can see something similar in other towns along I-5 but it's not as obvious for some of the towns. It's really fun to look at historical maps to see how the towns have grown over time.
But it's not always a town that causes the deviation. Sometimes it's just an exit, as the overpass won't allow exiting onto the frontage road:
Why follow the railroad at all? My guess is that back when the US government was trying to encourage a transcontinental east-west railroad, they gave the railroads 200ft land adjacent to the track. That space would've been something the government could later use to build the freeways.
Labels: transportation
Emacs: marking text #
Although I primarily use Emacs, I love the idea of vim text objects, and wanted to incorporate them into my editing. The Kakoune introduction explains that vim uses verb first, noun second for its commands, whereas Kakoune uses noun first, verb second. I wrote a blog post about why I prefer noun-verb over verb-noun, not only in text editors but also in games and other applications.
Labels: emacs
Axial name highlighting #
I like to try various things out in my editor to see if they're useful. Most are interesting but not useful. On my guide to hexagons I use colors for the three hexagon axes (q, r, s). I thought it might be cool to do something similar in the text editor, for x and y:

Labels: emacs, programming
Beer mode and coffee mode #
Over the years I've mentioned to people that I work in two modes:
- Beer Mode 🍺
- I'm relaxed and make connections between many different ideas. I can come up with new creative ideas.
- Coffee Mode ☕
- I'm focused and make progress on my work. I am productive and can complete existing projects.
I assumed that the names "Beer Mode" and "Coffee Mode" are something I saw somewhere. But then when I went looking for it, I couldn't find any source. It seems to be called "open mode" and "closed mode" by others. So it's possible that these terms are something I came up with! I mentioned it on Twitter and David Perell wrote a page about it.
I had a similar experience when I said Dreams are malleable — I assumed I had seen this somewhere but I couldn't find a good source, so it's possible my brain came up with that phrase too. And also possibly this one. I say lots of off-the-cuff things (in beer mode) and don't remember most of them.
Non-consensual personalization on the other hand is a phrase I carefully thought about.