Finished reading Edgedancer by Brandon Sanderson π
I built some AppleScript applets to launch Gmail to a specific account and Brave to a specific Profile (could also be done with Chrome) but I didn’t like the generic “Script” icon.
At first I just pasted my custom image into the “Get Info” window to update the icon but then when I made changes to the app and re-saved it, the icon got reset. I wanted to permanently updated the “applet.icns” file in the bundle but I didn’t want to spend an hour fiddling around with all the icon sizes.
Turns out, creating an icon set is super easy once you have your starting image:
You now have an ICNS file with all 10 variations in it:
Step 2:
Step 3:
Step 6:
I finally solved a hugely annoying performance bug in one of my Rails apps! To give you an idea of how bad it had gotten, just before the fix an admin page I use 5-10 times every Saturday was averaging 21,114.2 milliseconds per load!!! π± Although really, when the times are that large, milliseconds is probably the wrong unit of measurement… That page was taking 0.00024 days to load!!! And the trend was only getting worse!
That same page is now averaging 22.4 milliseconds, about 3 orders of magnitude quicker!
I’d been trying to figure it out for months but I was hampered by a combined lack of:
The tooling problems were particularly frustrating so I owe a massive thank you to Nate Berkopec from Speedshop who not only puts out a ton of great content but was also very patient with my beginner questions about why my flamegraphs weren’t working. I didn’t end up figuring out that problem, but at Nate’s suggestion I switched to rbspy to create a flamegraph and within about an hour I’d figured out the problem that I’d previously spent months off and on trying to solve.
It turns out that every time I fetched a person from the database, my app was generating a random password for them. That process is a bit slow (possibly by design? to avoid timing attacks?? maybe???). Individually, 200 milliseconds to generate a password isn’t a big deal… but on the admin page I load a list of all the people, so every time a new person got added, the page slowed down by another 1/5 of a second π€¦ββοΈ
In the end the fix was super simple, I now only generate the random password (and other default values) if the person isn’t already in the database:
# Before
after_initialize :set_default_values
# After
after_initialize :set_default_values, if: :new_record?
18 more characters to remove a 94,160% slow down! Plus now the user facing pages are down below 30 milliseconds too! π₯³
For future reference, here’s how I tracked down the issue:
tmp/pids/server/pid
sudo --preserve-env rbspy record --pid 86229 --format speedscope --subprocesses
sudo --preserve-env rbspy record --pid `cat tmp/pids/server/pid` --format speedscope --subprocesses
]~/Library/Caches/rbspy
into speedscopeThis will be my last M.b post cross-posted to Twitter.
You can find everything I write at matt17r.com (also available via RSS) and for those on Mastodon, Micro.blog is already compatible: @matt@matt17r.com
Finished reading Words of Radiance by Brandon Sanderson π
Over 1,000 dense pages but I thoroughly enjoyed it. Looking forward to the rest of the series arriving in country next month.
After doing some research today it seems there is no way to block the Files app using Apple’s Screen Time settings. Even when the entire device is locked at Downtime, there is no way to block the Files app. Chlidren can therefore use the Files app at any time of the day or night to:
I suspect this also means that time in the Files app isn’t tracked as part of the Screen Time time limits.
Some restrictions still apply despite this fairly large loophole:
This seems like a pretty big gap in Screen Time to me. If you care about this and happen to know anyone at Apple you can prod, I’ve filed Feedback 11953747.
Finished reading: The Way of Kings Part Two by Brandon Sanderson π
Finished reading: The Way of Kings Part One by Brandon Sanderson π
In the nick of time before semester 2 starts tomorrow, I just finished The Lost Metal by Brandon Sanderson π
Finished reading: The Bands of Mourning by Brandon Sanderson π
Finished reading: Shadows of Self by Brandon Sanderson π
Finished reading: The Alloy of Law by Brandon Sanderson π
Finished reading: Mistborn, The Well of Ascension and The Hero of Ages by Brandon Sanderson π
PSA for macOS Terminal users:
Terminal Prefs β Profiles β Shell:
No more accidentally killing your local dev server with βQ. To close a terminal tab/window without confirmation close the shell with ^D
Thinking about ways to disambiguate the same username on different federated instances based on a question from @manton
Pic shows the same username on mastodon.social and ruby.social. Avatar colour would be dynamic but always the same for the same service…
Installing Teams for an upcoming meeting and noticed the installer is called “Teamsosx”. OS X was renamed macOS in 2016, almost a year before Teams was released. It’s inattention to details like this that make Microsoft products really stand out π
Trying to stay positive online so rather than bash Hover I’ll compliment Cloudflare. Cloudflare domain registration is:
80% of my domains now transferred π
Our house is all ceramic tiles and concrete, terrible for acoustics! So hereβs my improvised recording studio; kneeling on the ground with my head in the sound absorbent caveβ¦
Technology can be good but Iβd be okay if I never had to do another video callβ¦ VR meetings really donβt appeal to me!
Watch out for GitGuardian. They scan public GitHub repos unbidden & send unsolicited emails about “exposed secrets” to trick you into signing up. Once you’re in, they request access to all your repos then waste your time telling you about dozens of exposed “secrets” that aren’t π
If you think youβre leading and no one is following you, then youβre only taking a walk β Afghan Proverb*
*Maybe, I’m choosing not to go down the rabbit hole of looking for the origin of this phrase/sentiment
A month or two in and Iβm super happy to have found Nova as a capable (and native!!!) replacement for Atom.
I tried VS Code but, even without plugins, it felt busy and bloated.
Still learning not to hit β T for fuzzy open though π
Enjoyed watching WWDC this year! One nice thing about being in Cambodia is that it went from midnight to 2am, rather than 3am-5am in Sydney.
Almost time for a new laptop, struggling to decide between the 14β M1 Pro MBP or 13.6β M2 MBA π€