Pragmatism in the real world

Updated rst2pdf website

Earlier this year, Lorna spent some time updating rst2pdf's website to use Sphinx. The nice thing about Sphinx is that it uses restructuredText, the same as rst2pdf does, so we now stay in the same ecosystem. While, we could have continued using Jekyll, it makes much more sense for us to use the same markup language as we use for the main tool, and our manual is written in it too. With the Jekyll system,… continue reading.

Using OneOf for a property in an OpenAPI spec

When writing an OpenAPI specification, I came across the need for a particular property in an error response to be either a string or an object. This situation came about when validating a POST request that takes an items property that is a list of objects As a contrived example of a pet with accessories, consider this example request in curl: curl -X "POST" "http://api.example.com/pets" \ -H 'Content-Type: application/json' \ -d $'{ "name": "Rover", "items": [… continue reading.

Additional parameters on a PHP interface method

On the Roave Discord recently, there was a discussion about not breaking BC in interfaces inspired by this post by Jérôme Tamarelle: It's clearly true that if you add a new parameter to a method on an interface, then that's a BC break as every concrete implementation of the interface needs to change their signature. However, Gina commented that you don't need to use func_get_arg() as concrete implementations can add additional optional arguments. WHAT?!!! I… continue reading.

Some thoughts on LLM usage in my work

While it would be nice to put the genie back in the bottle, that hasn't happened often in human history, so for the foreseeable future, AI in the form of LLMs are here to stay. I imagine that what we use them for will change over time as we collectively internalise their limitations. Personally, I'm now using them for my work as much as I reasonably can. This is involving many different areas, such as… continue reading.

Previewing OpenAPI specs using redocly's Docker container

To provide consistency between the environments of our developers, I'm a strong proponent of using containers so that every developer is using the same versions of our tools. This is really important for command line tooling that depends on a separately installed language such as NodeJS or PHP as a simple npm i -g can install wildly different versions if a dev is running an older (or newer!) version of Node. For OpenAPI specs, listing… continue reading.

Using the Stripe CLI with with Docker Compose

One of the projects that I'm working on at the moment uses Stripe which means that we need to handle web hooks in order to ascertain what's happened as that's how Stripe communicates back to us. For production and staging, it's easy enough to register a url on Stripe's dashboard, but when developing, it's a little more complicated as our computers are generally isolated from receiving incoming web requests from the public internet, along with… continue reading.

No SSL padlock on Safari on macOS 18.4

With the release of macOS 18.4, Safari no longer shows a padlock when you visit a website that uses https. I assume there's a reason for this but I was scratching my head trying to work out how to view the SSL certificate when I went to a new-to-me website domain that my bank asked me to go to. This is what the address bar now looks like when you're on a secure connection to… continue reading.

Generating scripts with LLMs

With the recent release of the new OpenAI ChatGPT that can do image generation, I thought that I might add a feature image to my last blog post. I've had mixed experiences of AI generation of images, probably because I'm not good at prompting them. I started with this: We now have an image, but it doesn't have a credit. Now, I could go back to the LLM and ask it again, but these things… continue reading.

Backing up Signal messages on Mac

I'm using Signal more now and as it's fully end-to-end encrypted, if something goes wrong with your phone or you lose it, you will lose your entire message history. Signal on Android has an official backup method, but there isn't one for iPhone or desktop. As a result, a number of backup tools have been written by various people. The one I've had most luck with on my Mac desktop is signalbackup-tools. Note that the… continue reading.

Getting the screen's size in a macOS screensaver

As a hobby project, I've been writing a screensaver for my Mac that displays my photos with a caption and date taken. To get the width and height of the screen so that I could size the image correctly, I used this code in my ScreenSaverView: self.screenWidth = frame.size.width self.screenHeight = frame.size.height However, I discovered that with two or more screens, sometimes the frame size returned was wrong and so the photo was either too… continue reading.