I found some clear, stackable shoeboxes on Amazon and after 20 minutes of assembly I had them arranged in our closet. They're large enough that they can accommodate two pairs of kids shoes or women's flats. I've been looking for opportunities to design and 3D print something custom and a divider for these shoeboxes seemed low stakes.
I love the less pager. You can use it to read, search, tail, and more. As with many versatile programs, however, the man page for less has a bazillion different options: $ man less NAME less - opposite of more SYNOPSIS less [-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~] There’s hardly a letter it doesn’t use! Of these, my favorites are: -S or --chop-long-lines . Truncate lines rather than wrapping them.…
I learned a new word today: mojibake ! Some of my old blog posts have random gibberish in them like ñ or ’ . I always assumed this was the result of some character encoding mismatch but I didn’t know exactly what was going on. While I was fixing this issue via find/replace technology, I did some reading to learn more. The short version is a mismatch between UTF-8 and Latin-1 (ISO-8859-1)…
You can open macOS’s Spotlight with cmd + space . Then you can type in math like (4 + 23) * 92 and it will show you the answer. I’ve been using this feature for awhile but I just learned that it can do a lot more than I realized! This came up because I typed 2**256 and it gave me the answer. Interesting…what else can it do? I couldn’t find a comprehensive list of supported features. This Stack…
Sometimes when I learn about a tool I think “wow, that would have been useful [when I had some problem in the past]”. That happened with pkill , which is a command you can use to stop a process accurately. Many years ago I was slogging through debugging a Selenium test failure in a Rails application with my coworker, Ron. Every time we made a change we had to stop the server, restart it, and…
I spent too much time on Twitter. I liked 10,064 tweets. Then I took these already curated tweets and ran them back again to find the ones that are (1) text-only, (2) not replies, and (3) made me laugh. These are the inaugural inductees to the Twitter Hall of Fame.
GUIs are great! But I’m used to typing cd , and sometimes I prefer that to clicking around to get somewhere. MacOS merges these worlds with cmd + shift + G . In the Finder it’s under Go → Go to Folder... . This opens a dialog where you can type a path to navigate to. It supports tab completion, it understands that ~ is your home directory, and it shows recently used options that you can navigate…
While working on Slack’s unfurl previews I needed to test what happens when the fetcher cannot access a site. People put a lot of different URLs into Slack; some of them are going to be unfetchable for various reasons. Pointing the fetcher at a URL that doesn’t resolve, or one that results in a timeout, is straightforward, but I don’t know enough to set up various bad SSL/TLS scenarios. Surely one…
diff is a well-known tool to see what lines are different between files; comm is a less-known tool to see the common lines. I found comm when I was looking for a way to identify lines that are shared (or not) between files. Specifically, I had two lists: one with all the APIs in my codebase, and another with all the tested APIs. From this I wanted to get a list of untested APIs. As an aside, my…
Armed with this knowledge I declared it the Summer of Shrub. Why dip your toe in a hobby when you can dive in? I had more shrubs than I could fit into the fridge. I bullied friends and coworkers into making their own. "Stop trying to make shrub happen!" I imagined naysayers naysaying. But none could be found: everyone else just sipped from a glass I foisted upon them and enjoyed a remarkably…
awk is a whole programming language, but 90% of what I use it for is printing a subset of columns. This is pretty much covered by cut with two exceptions: re-ordering columns and printing the last column. Both cut and awk call columns “fields”. Here’s some sample tab-separated data (formatted with column -t !): FirstName LastName FavoriteColor Pet Elena Kowalski yellow hamster Marcus Rivera green…
I was filling out a form today and a friend joked, “You should put Number.MAX_SAFE_INTEGER in the budget field.” Woah! I didn’t know we had that constant. Number.MAX_SAFE_INTEGER was added to JavaScript in 2015 as part of ES6. The constant is new to me, but the value is a number I know by heart: 2**53 - 1. When I worked at Twitter, we switched from 32-bit IDs generated by MySQL to 64-bit IDs…
I used Ruby extensively at Twitter and it remains one of my favorite languages, especially for tools and scripts. That said, my knowledge of production Ruby is largely from the 1.8.7 / 1.9.3 era, which is quite old . We’re now on Ruby 4.0. I still write a lot of scripts and these days I ask Claude to write many of them for me. I noticed it wrote some stuff using the Pathname module. I assumed it…
I'm on a 52-week streak of solved Monday crossword puzzles in the New York Times (but Mondays are the easiest puzzles so we can agree not to be all that impressed).
Programmers are forever coming up with clever ways to represent data more compactly. Like storing the entire English dictionary using a trie ; or compressing fax transmissions 10x using run-length encoding ; or storing thousands of values in a few kilobytes using probabilistic data structures . I might not come up with one of these schemes myself but when I read how they’re implemented I’m usually…
Several years ago I tried to automate my new computer setup so that I could configure a new work laptop or home computer the way I like it easily. It went something like this: Put a list of Homebrew formula in a file. Write a script to loop over those and run brew install for each of them. Keep a list of apps like 1Password, Sublime Text, VS Code. Download and install those. The last time I…
I learned something new about shells today! You can use >(...) to write output to another process. You are almost certainly familiar with command substitution: ls -l $(which git) runs which git first and substitutes that as an argument to ls -l (you can also use backticks but they can’t be nested like $(..) ). You might know about <(...) which lets you turn the output of a command into a pseudo…
For years –maybe decades–I have repeated these steps when facing an open/save dialog box to select a file. If the file I want is on the Desktop, I use cmd + shift + D to navigate there. If it’s in my Downloads folder, which is common, I use this keyboard Rube Goldberg machine: Press cmd + shift + H to navigate to my home directory Start typing “Dow” to select Downloads Press cmd + down to open the…
I keep Gmail and my calendar in the first two tabs of my browser and often use cmd + 1 or cmd + 2 to jump to them. The shortcuts continue, with cmd + 3 selecting the third tab, cmd + 4 selecting the fourth, and so on. I rarely jump to the fourth or seventh tab and never the ninth. But cmd + 9 doesn’t jump to the ninth tab, it goes to the last, which I actually want quite often. That’s the stuff I…
The TZ environment variable changes the selected timezone for the duration of a command (or at least commands that are aware of TZ ). It’s handy to use with the date command: $ date Tue May 5 09:34:58 EDT 2026 $ TZ=UTC date Tue May 5 13:34:58 UTC 2026 I actually added alias utc="TZ=UTC date" to my shell so that I can double-check the time when I’m looking at logs with UTC times.