Baseball is not considered a major sport here in Australia, yet it definitely has a presence. I know of 4 baseball diamonds around where I live, and I usually spot flyers from local baseball clubs looking for new players. It’s not a recent thing either: my dad actually played baseball growing up.
I’m not really capable of doing a lot right now, but one thing I did do last night was add the ability to synchronise the posts I write in that Kev Quirk inspired journaling app to a Git repository. I’m still treating it like a prototype, but I’ve been finding myself turning to it whenever I want to write a journal entry. Might be that this will eventually become my replacement for Day One, although ensuring that the posts are safe and sound was one of the last remaining hurdles to that happening. So it’s good to see this working now.
How is it only 13:41? This day has been grindingly slow.
It’s curious to wonder why Alstom, the maker of these trains, don’t track when passengers press the button just before the tone sounds. It happens quite often: they press it a second too early, stand there in front of the closed doors, press it again, and the doors open. Need to hire more game devs.
Someone at work just discovered the killer app for Google’s NotebookLM podcasting feature: going through the terms and conditions of insurance policies.
Passing
Three nights ago, and two months before her 94th birthday, my Nonna, my maternal grandmother, suffered a stroke. She’s now in palliative care and there’s no telling how much longer she has left. Over the last few years she was slowing down, yet was still quite aware and was able to do many things on her own, even travel to the shops by bus. She had a scare over the weekend but was otherwise in reasonably good health. So all of this is incredibly sudden.
I was unsure as to whether or not I wanted to actually write this post. I did have a draft planned yesterday, with the assumption that she wouldn’t make it through the night. Delaying it any further did not seem right. Neither is making this an eulogy or display of public grief — that’s not how I like to do thing. But to not acknowledge that any of this is happening felt just as wrong, at least for now.
But what seemed right was a public declaration that I love her and I’ll miss her. I consider myself lucky to have said that to her in person, while she was lucid.
So, what now? Timelines at this stage are uncertain. Would it be hours? Days? Who can say. I guess following that would be the funeral and other matters pertaining to the estate, but that won’t happen for a week or so. What about today? Does one simply go about their day as one normally would? Does life go on? Seems wrong that it should be so, yet I’m not sure there’s anything else that I’m capable of doing. Just the daily routine smeared with sadness and loss.
I heard someone say that grief comes from love, that you can’t have one without the other. I can attest to that, but the edges of that double-edge sword are razor sharp. I know that eventually the pain will dull, and all that would remain are the memories. All it takes is time.
The issue with adding caching to a system before you know you’ll need it is that doing so isn’t free. You’re paying the price of invalidation and split-brain bugs before you see the benefits of increases in performance, if any. It’s a classic case of premature optimisation.
Testing and troubleshooting service side code, without an interactive debugger, that deals with single sign-on is the absolute worst. Do not recommend.
Just updated to Go 1.23.1. It’s so nice being able to upgrade my dev toolchain without having to worry about upgrading anything on our servers: binary executables are binary executables. By far, one of my favourite things about Go.
My current work laptop has a Touch Bar, and I think I will miss it a little when I get my next laptop that doesn’t have one. Having the ability to adjust the brightness and volume using a slider is much nicer than frantically pressing buttons. Oh, and also the ability to replace buttons without being stuck with the predefined glyphs. I replaced the Siri button with the Lock Screen button, which I use all the time, and it’s nice being able to see the proper Lock Screen glyph for it.
That said, those are probably the only nice things about it, and I would probably think otherwise if I wasn’t using an external keyboard with function keys. I’m certainly not using the Touch Bar for anything else, even while using the laptop keyboard.
Keep forgetting that making a permalink to a highlighted bit of text on a web-page is a thing. Made such a link in Vivaldi by highlighting the text and selecting “Copy Link to Highlight” from the context menu. Worked like a charm.
Working on Jira ticket number CLC-1836. The numerical congruity has not gone unappreciated.
New path day. This was little more than a goats track last time I was around here, but was recently widened to something a little more “official.”
Tools And Libraries I Use For Building Web-Apps In Go
I think I’ve settled on a goto set of tools and libraries for building web-apps in Go. It used to be that I would turn to Buffalo for these sorts of projects, which is sort of a “Ruby on Rails but for Go” type of web framework. But I get the sense that Buffalo is no longer being maintained. And although it was easy to get a project up and running, it was a little difficult to go beyond the CRUD-like layouts that it would generate (or it didn’t motivate me enough to do so). Plus, all that JavaScript bundling… ugh!
Huge pain to upgrade any of that.Since I’ve moved away from Buffalo, I’m now left to do more of the work up-front, but I think it helps me to be a little more deliberate in how I build something. And after getting burned with Buffalo shutting down, I think it’s was time to consider a mix of tools and libraries that would give me the greatest level of code stability while still being relatively quick to get something up and running.
So, here’s my goto list of tools and libraries for building web-apps in Go.
- HTTP Routing: For this, I use Fiber. I suppose using Go’s builtin HTTP router is probably the best approach, but I do like the utility Fiber gives for doing a lot of the things that go beyond what the standard library provides, such as session management and template rendering. Speaking of…
- Server Side Templating: Nothing fancy here. I just use Go’s template engine via Fiber’s Render integration. It has pretty much all I need, so I don’t really look at anything else.
- Database: If I need one, then I’ll first take a look at Sqlite. I use the modernc.org Sqlite driver, as it doesn’t require CGo, making deployments easier (more on that later). If I need something a bit larger, I tend to go with PostgreSQL using the pgx driver. I would also like to use StormDB if I could, but it doesn’t play well with how I like to deploy things, so I tend to avoid that nowadays.
- Database ORM: I don’t really use an ORM (too much PTSD from using the various Java ORMs), but I do use sqlc to generate the Go code that interacts with the database. It’s not perfect, and it does require some glue code which is tedious to write. But what it does it does really well, and it’s better than writing all that SQL marshalling code from scratch.
- Database Migration: I’ve tried using golang-migrate before, and we do use it at work for PostgreSQL databases, but it doesn’t work well with the modernc.org Sqlite driver. So I ended up writing my own. But if it makes sense to use golang-migrate, I will.
- JavaScript: I try to keep my JavaScript usage to a minimum, favouring vanilla JavaScript if I only need a few things. For anything else, I usually turn to Stimulus.js, which adds just enough “magic” for the slightly more involved pieces of front-end logic. I’m also looking at HTMX, and have tried it for a few things, but I’ve yet to use it for a complete project. I use esbuild if I need to bundle my JavaScript, but I’m trying to go “builderless” for most things nowadays, relying on import maps and just serving the JavaScript as is.
- CSS: Much like JavaScript, I still prefer to use vanilla CSS served directly for most things. I tend to start new projects by importing SimpleCSS by Kev Quirk. It makes the HTML look good right out of the gate, but it does make each project look a little “samey” but that’s up to me to address.
- Live Reloading: I’ve only recently been a convert to live reloading. I did use it when I was bundling JavaScript, but since moving away from that, plus doing most things server-side anyway, I needed something that would build the entire app. I’ve started using Air for this, and it’s… fine. There are certain things that I don’t like about it — particularly that it tends to favour configuration over convention — but it does the job.
- Deployment: Finally, when I’m ready to deploy something, I do so using Dokku running on a Linux server. I bundle the app in a Docker container, mainly using a Go builder image, and a scratch image for the run-time container (this scratch container has nothing else in it, not even libc, which is why I use the modernc.org Sqlite driver). All I need to do is run
git push
, and Dokku does the rest. Dokku also makes it easy to provision PostgreSQL databases with automated backups, and HTTPS certificates using Lets Encrypt. Deploying something new does involve logging into the remote server to run some commands, but having been burned by PaaS providers that are either too pricy, or not pricy enough to stay in business, I’ve found this setup to be the most stable way to host apps.
So, that’s my setup. It’s a collection that’s geared towards keeping the code low maintenance, even if it may come at the cost of scalability. I can’t tell you anything about that myself: I’m not running anything that has more than a couple of users anyway, and most things I’m running are only being used by myself. But I think that’s a problem for later, should it ever arise.
I may never have a site as popular as those I read. I may never be in a situation where I can just rattle off a domain as if it was a business card. But it’s nice to have the option to do so. And, for me at least, it’s probably the best answer I can give when asked by someone “where is the best place to find you online," in lieu of giving out some social media handle. And I think, on the whole, that’s a good thing.
I don’t have a blog post today. The well’s been pretty dry all week if I’m honest. Usually at times like these, I hold off posting until the evening, hoping that something worth writing about will come by before the day’s end. We’ll see if that happens today. But if not… well, there’s this. 🤷
📺 Office Space (1999)
It’s a shame XML namespaces are not as widely used as they probably should be. I still see XML documents that escape nested XML documents as if they were strings, something XML namespaces were meant to be a solution for.
There’s code spelunking, which can be rather interesting. Where you explore the depths of code and decisions past made and wonder at why it is and how it all works.
Then there’s Jira spelunking, where you’re just fighting with your rock pick.
Reading about all the annoying permission notifications in MacOS Sequoias, I wonder how Apple devs actually experience this. Would they be using tools that would require them to record their screen as part of their job? And if so, are they experiencing any of these monthly notifications?
Might be that they’re using all in-house software for anything that would do this. I hear Apple’s pretty famous for doing so — going as so far as making an iOS app to order from Cafe Macs. And since Apple trusts software from Apple, it might be that they aren’t seeing these notifications nearly as often as their customers, who can’t run such privileged software themselves1.
I guess this is a roundabout way of say that maybe employees from Apple, up and down the org chart, need to run more third-party software on their work machines. That way they can get the full “experience” of using software stuck with throwing up a notification every month to do it’s job.
In any case, I think I’ll hold out on upgrading to MacOS Sequoias for the foreseeable future.
-
It’s either that, or they are seeing these notifications and are told to just deal with it, which is probably worse. ↩︎