More from Don Melton
Safari and WebKit aren’t teenagers anymore. I just want to make note of that. To quote a previous post: On June 25, 2001, I arrived at Apple Computer to lead the effort in building a new Web browser. It was also Ken Kocienda’s first day on the job, both at Apple and on that same project with me. For that reason, Ken and I have always considered our start date to be when Safari and WebKit were born. Not any other position on the calendar. Only June 25, 2001. We were there. We should know. That was 20 years ago today. Twenty years! Of course, it’s been over nine years since I retired from Apple. Obviously, I’m not a teenager anymore either. But I still remember that first day clearly. So, happy birthday to Safari and WebKit and the team now tasked with their adult supervision.
For whatever reason I started blogging again last week. Not knowing why isn’t due to a lack of introspection on my part. Maybe the nauseating weight of the Trump administration was suppressing my desire to write for the previous three-and-a-half years? Or maybe I’m just arbitrary and lazy? It’s also unclear how long I can keep this up. Inspiration and a willingness to type are not something which you can purchase online or install with a package manager. I suppose we’ll find out. However, the mechanics of blogging again are simpler to understand. For one thing, as I write here: … this website is only free-range, handcrafted, artisanal HTML. With a little CSS, of course. No JavaScript—that’s just crazy talk. Technically, it’s all created using software. I don’t actually type all that markup manually, like some filthy animal. And since the site remained unchanged from the time I generated it during June of 2017, it was still working fine as of last week. Keep that in mind when you consider the architecture for your own blog. Once you’ve created it, static HTML is pretty much maintenance free. However, there’s that whole problem of generating it again. With new content. Yeah. I had all the publishing software, content, configuration, etc. installed on my Mac originally. But since we all know I’m using a Windows PC now, I had to migrate everything. That meant just copying my blog posts since they’re simply Markdown documents with YAML frontmatter. Easy. But my content management system is Nanoc, a Ruby-based generator. And while it’s reasonably cross-platform and mostly runs on Windows, it’s not officially supported there. More importantly, the scripts and other tools I built on top of Nanoc were kinda Unix-adjacent, if you know what I mean. This is where the Windows Subsystem for Linux (WSL) came to the rescue. Normally, I use the Windows-specific version of ruby.exe for my other projects. But with WSL, you really need to apt-get ruby and shove that baby into Ubuntu as well. After that it was just a gem install of nanoc and kramdown, my Markdown parser of choice. At least, I thought that’s all I needed. Turns out the kramdown-parser-gfm Gem is required too since I depend on GitHub-flavored Markdown and the kramdown developers removed support for it from the main project back in 2019. Surprise, surprise. But that’s what I get for not parsing any Markdown for so damn long. By the way, for any of you also installing Ruby Gems in WSL or other Unix-like environments, don’t preface gem install with sudo. This is both unnecessary and unwise. It’s unnecessary because you can simply append --user-install to those installation commands. This will place them in ~/.gem, your local Gem directory. And it’s unwise because you don’t want them placed in your system-wide Gem directory. Doing so will delete, overwrite or otherwise fuck them up whenever you update ruby itself. Of course, you’ll need to add that local Gem directory to your $PATH variable in ~/.bash_profile or whatever the equivalent is for your shell. Otherwise the shell can’t find those Gems. Duh. Here’s an example ~/.bash_profile showing how to do just that: if [ -f ~/.bashrc ]; then . ~/.bashrc fi PATH=$HOME/.gem/ruby/2.7.0/bin:$PATH Obviously the version of ruby in that path will need to be adjusted if yours if different. So after getting the correct Gems installed in the correct places, I then had to make a few changes to my Nanoc configuration files and various homebuilt Unix-y scripts. These were mostly just converting some hard-coded macOS-specific directory names to their Windows-specific equivalents. And then… it all worked. Flawlessly. Which means migration was not really much of a problem at all. Sure, thinking ahead on what I needed to do took awhile, but that actual typing necessary to make it happen was just a matter of minutes. Kind of anticlimactic, really. Of course, now I have to figure out what to write. Dammit.
Today is a good day. Joseph Robinette Biden Jr. has been inaugurated as our 46th president. And Kamala Devi Harris as our 49th vice president. While they cannot immediately undo the American carnage inflicted upon us by the previous administration, at least the vindictive malevolence has stopped now. Finally, and ironically, fulfilling the promise made four years ago by Donald Trump, deposed tyrant and career criminal. So let’s take a moment to unload that uncomfortable weight off our chests and shout in celebration. Fuck yeah! ‘Murica!
I have faith in Joe Biden. And Kamala Harris. They’re good people. They and the team they’ve selected know what they’re doing. It’s obvious just listening to them. So I can barely wait for them to take over the White House tomorrow. Because real governance will be back in residence. And we need all of that to make it through this pandemic. Along with a crushing number of other crises. But even after Trump slithers back to Florida—with a few of his favorite swamp creatures in tow—his enablers in federal, state and local government aren’t going anywhere. And they don’t believe in accountability for him or themselves. Then there’s 75% of Republican voters out there who still think the election was stolen and that Biden is an illegitimate president. Which means The Big Lie isn’t going anywhere either. Don’t ever assume it’s just a small minority that suddenly developed a taste for bullshit. Worse, Trump might be without a platform but he’ll continue to incite his army of insurrectionists with more grievance and more lies. Not all of these people are silly cosplayers. There are enough with military training and weapons to cause significant damage. God only knows what they’ll do the next time. Possibly pose as real troops or law enforcement. If we’re lucky, Trump will just blow up the Republican Party instead of the whole country. But let’s not bet on being lucky. We need to be vigilant. This isn’t over yet.
More in programming
As part of my work on #eng-strategy-book, I’ve been editing a bunch of stuff. This morning I wanted to work on two editing problems. First, I wanted to ensure I was referencing strategies evenly across chapters (and not relying too heavily on any given strategy). Second, I wanted to make sure I was making references to other chapters in a consistent, standardized way, Both of these are collecting Markdown links from files, grouping those links by either file or url, and then outputting the grouped content in a useful way. I decided to experiment with writing a one-shot prompt to write the script for me rather than writing it myself. The prompt and output (from ChatGPT 4.5) are available in this gist. That worked correctly! The output was a bit ugly, so I tweaked the output slightly by hand, and also adjusted the regular expression to capture less preceding content, which resulted in this script. Although I did it by hand, I’m sure it would have been faster to just ask ChatGPT to fix the script itself, but either way these are very minor tweaks. Now I can call the script in either standard of --grouped mode. Example of ./scripts/links.py "content/posts/strategy-book/*.md" output: Example of ./scripts/links.py "content/posts/strategy-book/*.md" --grouped output: Altogether, this is a super simple script that I could have written in thirty minutes or so, but this allowed me to write it in less than ten minutes, and get back to actually editing with the remaining twenty.
I’m trying something a bit different today – fiction. I had an idea for a short story the other evening, and I fleshed it out into a proper piece. I want to get better at writing fiction, and the only way to do that is with practice. I hope you like what I’ve written! When the fire starts, I am already running for the exit. When the fire starts, the world is thrown into sharp relief. I have worked in this theatre since it opened its doors. When the fire starts, my work begins – and in a way, it also ends. When the fire starts, they run beneath me. When the fire starts, they leave their bags behind. Their coats. Their tickets. They hear me, though I have no voice. When the fire starts, I know I will never leave. When the fire starts, I will keep running. I will always be running for the exit, because somebody must. A “running man” exit sign. Photo by Mateusz Dach on Pexels, used under the Pexels license. Hopefully it’s clear that this isn’t a story about a person, but about the “running man” who appears on emergency exit signs around the world. It’s an icon that was first devised by Japanese graphic designer Yukio Ota in 1970 and adopted as an international symbol in 1985. I was sitting in the theatre on Friday evening, waiting for the second half to start, and my eye was drawn to the emergency exit signs. It struck me that there’s a certain sort of tragedy to the running man – although he guides people to the exit, in a real fire his sign will be burnt to a crisp. I wrote the first draft on the train home, and I finished it today. I found the “when the fire starts” line almost immediately, but the early drafts were more vague about the protagonist. I thought it would be fun to be quite mysterious, to make it a shocking realisation that they’re actually a pictogram. I realised it was too subtle – I don’t think you’d necessarily work out who I was talking about. I rewrote it so you get the “twist” much earlier, and I think the concept still works. Another change in the second draft was the line breaks. I use semantic linebreaks in my source code, but they get removed in the rendered site. A paragraph gets compressed into a single line. That’s fine for most prose, but I realised I was losing something in this short story. Leaning into the line breaks highlights the repetition and the structure of the words, so I put them back. It gives the story an almost poetic quality. I’ve always been able to find stories in the everyday and the mundane – a pencil is a rocket ship, a plate is a building, a sock is a cave. The only surprising thing about this idea is that it’s taken me this long to turn the running man into a character in one of my stories. I really enjoyed writing this, so maybe you’ll see more short stories in the future. I have a lot of ideas, but not much experience turning them into written prose. Watch this space! [If the formatting of this post looks odd in your feed reader, visit the original article]
The difference between "low prices" as a race to the bottom or as a success story (like Amazon, Costco, IKEA, Vanguard) is in leveraging intentional weaknesses.
Building a mental model of computer architecture from first principles
One of life's greatest simple pleasures is creating something just for yourself.