Finished reading: Rhythm of War Part Two by Brandon Sanderson 📚
Finished reading: Rhythm of War Part One by Brandon Sanderson 📚
I wanted to put a banner on the test/staging copy of our library management system to make it easier for the librarian to know which system he is using.
var div = document.createElement("div"); div.style.position = "fixed"; div.style.right = "0"; div.style.top = "0"; div.style.zIndex = "100"; div.style.color = "white"; div.style.fontSize = "30px"; div.style.transform = "rotate(45deg) translate(27.5%, -40%)"; div.style.minWidth = "200px"; div.style.fontWeight = "bold"; div.style.fontStyle = "italic"; div.style.boxShadow = "0px 2px 2px 1px #1209096e"; div.style.textShadow = "2px 2px 4px #5400007d"; div.style.background = "radial-gradient(circle, rgb(255, 10, 0) 0%, rgb(200, 0, 0) 90%)"; div.style.textAlign = "center"; div.innerHTML = "TEST"; document.body.appendChild(div);
Finished reading: Dawnshard by Brandon Sanderson 📚
Finished reading: Oathbringer Part Two by Brandon Sanderson 📚
Today I learned that Cloudflare has a free alternative to ngrok, Cloudflare Tunnel
Can use it without logging in on their domain or set it up with named destinations at own domain
Just finished Oathbringer Part One by Brandon Sanderson 📚 Might have to wait a few weeks until holidays to read part two… and the rest of the series.
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:
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:
sudo --preserve-env rbspy record --pid 86229 --format speedscope --subprocesses
sudo --preserve-env rbspy record --pid `cat tmp/pids/server/pid` --format speedscope --subprocesses]
This 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: @firstname.lastname@example.org
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 📚
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 😉