Periodic reminder:
"Strings in Swift are Unicode correct"
It is not possible to have a String that is not valid Unicode, and so it is not possible for a String to fail UTF-8 conversion.
So there is no reason to use the failable `string.data(using: .utf8)!` that Swift bridges from NSString.
You can just use `Data(string.utf8)` and avoid the Optional.
In many cases, String(decoding:as:) is also a better choice than String(data:encoding:), but that depends on your use case a little.
TIL: you can check if a number is prime using the regular expressions (ish)
/^1?$|^(11+?)\1+$/
In practise /^(11+?)\1+$/ finds all strings of some series of 1s followed by some number of repeats of that initial series of 1s. X(X+)
And /^1?$/ is a edge case check for one.
https://www.noulakaz.net/2007/03/18/a-regular-expression-to-check-for-prime-numbers/
If you ship an app for macOS, please do this! I hardly see this at all with Mac apps.
In your info.plist, add `MDItemKeywords` and the value is a list of keywords for your app separated by commas. This will show up in your More Info window for your app under “Keywords”.
Why is this useful? Let’s say you make a Mastodon client app called anything BUT Mastodon, if you throw “Mastodon” in this list in `MDItemKeywords`, searching “Mastodon” in Spotlight would surface it as a search result!
What’s it like to live on a “residential” street in San Francisco?
4,000+ cars and trucks per day (metrics measured between 6 AM and 8 PM only)
This is policy and infrastructure failure.
Never let your government get away with claiming that #bikeHelmets are "the first rule of bike safety".
Rule number one is infrastructure, and the 2nd is air+brakes+chain mechanical soundness of the bike, upright geometry of the bike, traffic awareness, ride with fingers on your brake levers and having practiced emergency stops, twenty is plenty... Helmets are for stunts or a footnote to "don't fall on your head" rule that applies to walking moreso than biking.
The Norman Foster exhibition at the Centre Pompidou was really inspiring.
Amongst many other beautiful drawings and models, there are really nice drawings of the early #ApplePark designs.
Hiring a software engineer in their late 40s:
Pros:
* Understands your stack better than you do after glancing through the repo for five minutes.
* Will rewrite said stack 2x as fast, and half as buggy if you let them.
Cons:
* Gives zero fucks.
* Knows we're not *really* like family here.
* No, seriously, absolutely zero fucks given.
Do not cite the deep magic to me, product manager, I was there when it was written.