Tim Sneath @sneath.org · 13/02/2025OK, 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? 150
Tim Sneath @sneath.org · 01/01/2025My wife informs me that this is not, in fact, intended for use to help men pee without making a mess of the toilet. 060
Tim Sneath @sneath.org · 01/01/2025Just 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! 2111
Tim Sneath @sneath.org · 16/12/2024As folk start to wind down for the break, sending you all seasonal wishes. Wear your ugly Christmas sweaters proudly! #MerrySwiftmas 2300
Tim Sneath @sneath.org · 10/12/2024Safari 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! 1234
Tim Sneath @sneath.org · 08/12/2024Fun 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/20244/ 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/20243/ 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/2024I'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/2024For 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/2024Also leads to fun extensions like this, which makes today's Advent of Code exercise easy in Swift! 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 4201
Tim Sneath @sneath.org · 02/12/2024OK, 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/20245. [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/20244. 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/20243. 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. 120
Tim Sneath @sneath.org · 01/12/20242. 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/2024I'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/2024It'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/2024Proud of myself for completing today’s 5K Turkey Trot 😅 Why do my daughters look like they didn’t even exert themselves?! 🌼 0140
Tim Sneath @sneath.org · 28/11/2024Or 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/2024You 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/2024It'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. 81165
Tim Sneath @sneath.org · 27/11/2024I 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. 3291