Tim Sneath
banner
sneath.org
Tim Sneath
@sneath.org
Developer tools and frameworks at Apple. I aspire to build delightful products, and to make others smile.
OK, here's a fun prompt -- paste this prompt into ChatGPT or your AI tool of choice. What does it know about you? How close is it?
February 13, 2025 at 3:33 AM
My wife informs me that this is not, in fact, intended for use to help men pee without making a mess of the toilet.
January 1, 2025 at 2:22 AM
Just watched the London fireworks on BBC -- they were completely wild! Hope they get a full replay for international viewing -- one of the best I've seen!
January 1, 2025 at 12:24 AM
As folk start to wind down for the break, sending you all seasonal wishes. Wear your ugly Christmas sweaters proudly! #MerrySwiftmas
December 16, 2024 at 2:10 PM
Safari tip of the day: grab a screenshot of a scrolling page from Developer Tools by right-clicking the HTML node and choosing "Capture Screenshot". Great for sharing a proposed website change without deploying somewhere!
December 10, 2024 at 11:07 PM
December 9, 2024 at 7:46 PM
Fun night last night! The legendary Branford Marsalis in Seattle, then the decorated gingerbread houses at the Sheraton. Guess which city this one is?!
December 8, 2024 at 9:18 PM
4/ Want to keep a manual page open while you're working on a command? Right click and choose "Open man page" -- it'll open a separate tall terminal window to that page so you can keep it handy.
December 4, 2024 at 11:57 PM
3/ Want to save your ssh and other CLI passwords? You can use the new Passwords app to autofill saved credentials into the command line too. Just right-click and choose AutoFill / Passwords...
December 4, 2024 at 11:57 PM
I'm going to share a few macOS Terminal tips I learned recently that others might find helpful.

1/ Ever find yourself with a long command and you just want to change one thing? Don't just hold down the left arrow button, instead Option+Click and the cursor will move to that location.
December 4, 2024 at 11:57 PM
For those of you following along with #AdventOfCode, you're probably groaning as you refresh your memory of regular expressions! Unless you're using #Swift, which has this lovely mini-DSL for expressing them. The two expressions below are equivalent, and Xcode can help you convert from the former.
December 3, 2024 at 11:40 PM
Also leads to fun extensions like this, which makes today's Advent of Code exercise easy in Swift!
December 2, 2024 at 10:20 PM
#Swift is full of helper methods that are really helpful for solving the kinds of problems you'll find in Advent of Code. Here are a few that might help you solve day 2 with a readable and efficient approach... #AdventOfCode
December 2, 2024 at 8:26 PM
That’s… an unfortunate headline.
December 2, 2024 at 3:43 AM
OK, off we go with #AdventOfCode! Day 1 was a gentle start, as is usually the case. I like that #Swift has:
distances.sort(by: >) // sorts an array in descending order
versus the approach of #Java:
Array.Sort(first, (a, b) => b.CompareTo(a));

Good chance to practice use of zip(a, b) too!
December 2, 2024 at 2:03 AM
5. [Optional] Lastly (since I'm making opinionated recommendations already), install tldr, the missing tool that improves on man by providing actually useful examples of the commands you need. tldr.sh
December 1, 2024 at 9:20 PM
4. Install Oh My Zsh. ohmyz.sh; then edit the ~/.zshrc profile file and set the ZSH_THEME environment variable to agnoster, as shown in the screenshot below.
December 1, 2024 at 9:20 PM
3. Edit the Nord theme to set Fira Code as the default. Hit the Change button and set it the typeface, style, size, character spacing and line spacing to the settings in the screenshot.
December 1, 2024 at 9:20 PM
2. The default terminal color schemes are fine, but I prefer something a bit more subtle. Download the Nord.terminal theme from github.com/nordtheme/te... and import it into Terminal. Click the "Default" button to set it as the default for all new windows.
December 1, 2024 at 9:20 PM
I'm surprised how many people see screenshots of my terminal settings and want something similar. I have five simple steps for anyone who wants to upgrade their default macOS terminal settings. In just a couple of minutes, you can have a clean setup with a useful git prompt and pleasant colors.
December 1, 2024 at 9:20 PM
It's happening! ☃️☃️☃️

Advent of Code starts in just a few hours, and you can sign up to join our Swift leaderboard here: forums.swift.org/t/advent-of-.... Thanks as always to @was.tl for bringing the coding joy to the season -- if you participate, consider supporting him with a tip...
December 1, 2024 at 12:09 AM
Proud of myself for completing today’s 5K Turkey Trot 😅 Why do my daughters look like they didn’t even exert themselves?! 🌼
November 28, 2024 at 6:59 PM
Or you can do a `guard let`, which inverts the above. Here you can handle the error condition and bail out early, which reduces unnecessary nesting. It's really quite elegant!
November 28, 2024 at 12:15 AM
You get used to this style very quickly in Swift, and it's concise for lots of different scenarios. For example, you can use try? to return a null rather than throw an exception, and then deal with it very naturally with an if let.
November 28, 2024 at 12:15 AM
It's fascinating to me how much legacy code gets carried forward to modern systems. For example, want to use this 1987 AT&T terminal as the front end to your Linux box or Mac mini? The terminal software in every modern POSIX system knows how to interface with it, and thousands of others.
November 27, 2024 at 6:41 AM