124 Followers
168 Following
88 Posts
 • visionOS • Music
If you have a visionOS app on TestFlight, I'd love to give it a try ♥️

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.

"Years ago, anthropologist Margaret Mead was asked by a student what she considered to be the first sign of civilization in a culture. The student expected Mead to talk about fishhooks or clay pots or grinding stones.
But no. Mead said that the first sign of civilization in an ancient culture was a femur (thighbone) that had been broken and then healed. Mead explained that in the animal kingdom, if you break your leg, you die. You cannot run from danger, get to the river for a drink or hunt for food. You are meat for prowling beasts. No animal survives a broken leg long enough for the bone to heal.
A broken femur that has healed is evidence that someone has taken time to stay with the one who fell, has bound up the wound, has carried the person to safety and has tended the person through recovery. Helping someone else through difficulty is where civilization starts, Mead said."
We are at our best when we serve others. Be civilized.

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/

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.

I joined an early-stage startup at the end of last year and today we launched.
https://getrex.app/ref/7WZyJTHAhOM
Get recommendations from your friends | Rex