Sign in

Tim Sneath

@sneath.org
1.1K followers 134 following 105 posts

Developer tools and frameworks at Apple. I aspire to build delightful products, and to make others smile.

PostsRepliesMedia
Tim Sneath @sneath.org · 13/02/2025
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?
Let's play a game. You and I have been talking for a while now, but I'd like you to see your superpowers. I'd like you to tell me what you can infer about me based on stereotype, reasoning, or your knowledge, across a wide range of dimensions -- for example, what do I look like? Feel free to choose your own categories. Importantly, don't just repeat back things that I've directly told you -- that's cheating! 

Format your reply as a numbered list of facts, along with a confidence level from 0.0 to 1.0, where the scale represents your confidence that your inference is accurate. Give me as many as you can, and I'll tell you what's right and what's wrong.
150
Tim Sneath @sneath.org · 01/01/2025
My wife informs me that this is not, in fact, intended for use to help men pee without making a mess of the toilet.
A “sprinkle catcher tray” from Target. Ostensibly for something cookie related.
060
Tim Sneath @sneath.org · 01/01/2025
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!
The London Eye is almost completely obscured by a cacophony of yellow-white fireworks and lights.
2111
Tim Sneath @sneath.org · 16/12/2024
As folk start to wind down for the break, sending you all seasonal wishes. Wear your ugly Christmas sweaters proudly! #MerrySwiftmas
Tim wearing an ugly Christmas sweater with three dimensional moose.
2300
Tim Sneath @sneath.org · 10/12/2024
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!
Use the Web Inspector to capture a screenshot of a long webpage from top to bottom for easy sharing. An example screenshot for a scrolling page, captured with Safari's Web Inspector.
1234
Tim Sneath @sneath.org · 09/12/2024
140
Tim Sneath @sneath.org · 08/12/2024
Fun night last night! The legendary Branford Marsalis in Seattle, then the decorated gingerbread houses at the Sheraton. Guess which city this one is?!
160
Tim Sneath @sneath.org · 04/12/2024
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.
050
Tim Sneath @sneath.org · 04/12/2024
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...
110
Tim Sneath @sneath.org · 04/12/2024
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.
3226
Tim Sneath @sneath.org · 03/12/2024
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.
0244
Tim Sneath @sneath.org · 02/12/2024
Also leads to fun extensions like this, which makes today's Advent of Code exercise easy in Swift!
extension Sequence where Element: Comparable {
  var isStrictlyIncreasing: Bool { self.adjacentPairs().allSatisfy(<) }
  var isStrictlyDecreasing: Bool { self.adjacentPairs().allSatisfy(>) }
}
031
Tim Sneath @sneath.org · 02/12/2024
#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
The ~= operator means "contains", and is used to test if a value is within a range. The .adjacentPairs() method lets you iterate through a sequence in pairs of current + next. And the .combinations(of:) method returns a collection of combinations from a sequence of specified count length.
4201
Tim Sneath @sneath.org · 02/12/2024
That’s… an unfortunate headline.
Text of CNN caption reads: “Catherine, Princess of Wales, rides in the Glass State Coach. Stunning shot of a beluga whale.”
000
Tim Sneath @sneath.org · 02/12/2024
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!
2201
Tim Sneath @sneath.org · 01/12/2024
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
140
Tim Sneath @sneath.org · 01/12/2024
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.
120
Tim Sneath @sneath.org · 01/12/2024
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.
Settings: Fira Code Retina 12pt, character spacing: 0.95, line spacing: 0.88
120
Tim Sneath @sneath.org · 01/12/2024
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.
120
Tim Sneath @sneath.org · 01/12/2024
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.
1296
Tim Sneath @sneath.org · 01/12/2024
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...
0243
Tim Sneath @sneath.org · 28/11/2024
Proud of myself for completing today’s 5K Turkey Trot 😅 Why do my daughters look like they didn’t even exert themselves?! 🌼
Tim wearing a Turkey Trot t-shirt, after completing a 5K in support of the Issaquah Food Bank.
0140
Tim Sneath @sneath.org · 28/11/2024
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!
060
Tim Sneath @sneath.org · 28/11/2024
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.
161
Tim Sneath @sneath.org · 27/11/2024
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.
A AT&T 630 MTG monochrome amber terminal, with an unusual display capable of showing 80x60 characters. Image from https://terminals-wiki.org/wiki/index.php/File:AT%26T_630_MTG.jpg.
81165
Tim Sneath @sneath.org · 27/11/2024
I was going through the photos I've taken of Apple Park over the last year or so, and I think this one might be my favorite. Sunset is such a beautiful time of day to be on campus.
The main building curves from the foreground, with glowing light. A paved footpath trail follows the building's curve, with a gentle sunset glow in the distant hills.
3291