Pragmatism in the real world

2019 in Pictures

As we reach the end of 2019, I again get the opportunity to look back at my year through the photos that I took as I have done every year since 2009. I have been doing a Project 365 for a good few years which acts as a diary too, so I have the opportunity to appreciate what happened this year in my life. January Early in January, I spent an afternoon taking photos with… continue reading.

Migrating to Lightroom Classic from Apple Photos

I recently moved over to Adobe's Lightroom Classic from Apple's Photos in order to have more flexible non-destructive editing features – in particular local brushes. Rather confusingly, there's also another Adobe product called Lightroom which is a new build for cloud-based storage which doesn't (yet?) have all the features of Lightroom Classic. In particular, the lack of virtual copies and smart collection sets make Lightroom feel like a step backwards from Photos, while Lightroom Classic… continue reading.

Routing in Slim 4

Routing in Slim 4 works pretty much exactly the same as in Slim 3. They are used to map a URL that the browser requests to a specific handler that executes the code for that particular page or API endpoint. You can also attach middleware that will only be run when that route is matched. The route in the slim4-starter looks like this: $app->get('/[{name}]', HomePageHandler::class); It is made up of the method, the pattern and… continue reading.

Keyboard shortcut to mirror displays on a Touch Bar Mac

One feature of the 16" MacBook Pro that was new to me is the Touch Bar. This thing replaces the F-keys with a touch pad that adjusts itself to the app in use in order to provide useful shortcuts you can just touch. This is all well and good, but when presenting, I use the cmd+F1 keyboard shortcut to toggle display mirroring. A useful Stack Overflow answer tells me that I can use cmd+{dim brightness}… continue reading.

My JetBrains IDE shortcuts

In the JetBrains IDEs, the "Default for macOS" keymap isn't doesn't feel very Mac-like to me, especially for keyboard navigation in particular. Apple provides details of the keyboard shortcuts you can expect to work in a Mac application, so these are the changes that I've made to make PhpStorm and PyCharm feel more at home on my Mac: Open Preferences and select Keymap from the left hand side. Then select "Default for macOS", click the… continue reading.

Dark and light mode blog images with MarsEdit

As dark mode is more popular than ever now that the iPhone supports it, I've been working out how to get the browser to render a dark image in dark mode and a light image in light mode. It turns out that the way to do this simply is to use the <picture> element like this: <picture> <source srcset="/wp-content/uploads/2019/11/example-image-dark.png" media="(prefers-color-scheme: dark)" /> <source srcset="/wp-content/uploads/2019/11/example-image-light.png" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" /> <img src="/wp-content/uploads/2019/11/example-image-light.png" alt="Description of example image… continue reading.

Cannot find zlib headers on macOS 10.15 Catalina

My new MacBook Pro 16" comes with Catalina and while setting up Python to develop rst2pdf, I discovered that Pillow wouldn't install. Running setup.py install for pillow … error ERROR: Command errored out with exit status 1: Looking through the long list of red text I came across: The headers or library files could not be found for zlib, a required dependency when compiling Pillow from source. Aha! The way this was solved on the… continue reading.

Changing an SQL Server primary key in Doctrine Migrations

I recently came across a rather weird quirk when trying to change a primary key in Sql Server using Doctrine Migrations: you need to use two migrations to get it to work. This is incredibly minor and I'm only writing it up as it confused me for a while so I thought that I'd document so that I'll find this article if I run across it again in the future! This is the migration: final… continue reading.

First steps with Windows on Vagrant

One thing that would be useful for one of my projects is an easy way to install IIS, PHP & SQL Server on Windows in a repeatable way. I wasn't sure how to do this until I came across Chocolatey and Boxstarter. Chocolatey is a package manager for Windows along the same lines as yum and apt for Linux and knows how to install a remarkable amount of software. Boxstarter is a way to automate… continue reading.

Testing migrating to Laminas

Zend Framework is renaming to Laminas and all the source code is moving to a new GitHub organisation. Implicitly this means a new PHP top level namespace. As you can imagine, this implies that a lot of our code will need to change, so Matthew, Michał and the team have been writing migration tooling to make this easier. It's now time to test it and they need all the help they can get on real-world… continue reading.