Pragmatism in the real world

rst2pdf: back from the dead!

Today marks a momentous day! I've released 0.94 of rst2pdf to PyPI! If you have a need to convert plain text files to PDF, check it out. As the last release, 0.93, was December 2012, I think you could have reasonably assumed that the project was abandoned. So why did I bring it back from the dead?

Setting up IBM Cloud Object Storage

For a little website that I'm writing, I thought that I'd use IBM Cloud Object Storage (equivalent to AWS S3) as I'm generating the pages using OpenWhisk on IBM Cloud Functions. The documentation is quite good if you want to use the website, but is a bit spread all over the place if you're using the command line, which is how I do things. As Cloud Object Storage is a bit of a mouthful, I'll… continue reading.

Keyboard control of macOS notification alerts

I use Apple's Reminders app to remind me about things that I need to do. It has the useful feature of syncing across my Mac, iPad and iPhone and I can add to it via Siri in my car. When I am notified on my Mac, a notification alert appears with two buttons: Complete and Later. Clicking Later offers a set of options to dismiss the alert and have it reappear in 5 minutes, in… continue reading.

Serverless PHP on AWS Lamda

Like, Simon Wardley, I think that serverless computing is an interesting space because the billing is granular (pay only when your code executes) and you don't need to worry about maintaining and provisioning servers or containers. So much so, that I maintain the Open Source PHP Runtime for Apache OpenWhisk which is available commercially as IBM Cloud Functions There are other serverless providers, and AWS Lambda is the market leader, but until recently PHP support… continue reading.

2018 in pictures

As 2018 draws to a close, I take the time to look at the past year as I have done in years past, I look at the photos that I've taken and reminisce about all that I've done this year. January I started the year with ongoing efforts to reduce the pain in my joints and then visited America for CodeMash in Ohio. This was my second consecutive year speaking at CodeMash and I really… continue reading.

Autojump is magic

One of my favourite command line utilities is autojump. It's a small command line utility that allows you to change directory without having to remember exactly where that directory is. For example, to start working on OpenWhisk, I simply type: j openw And the current directory is changed to /Users/rob/Projects/openwhisk/incuator-openwhisk for me. This is much easier than typing cd ~/Pro{tab}op{tab}in{return}! Biasing towards a particular directory When you have a directory that's a common one that… continue reading.

Upgrading to Bash 4 on macOS

Incredibly, macOS Mojave comes with Bash 3.22 by default still. Apparently this is due to licensing reasons, however Bash 4 has lots of lovely features including associative arrays that I'd like use. Hence, after reading the Internet for a bit, I've installed it on my Mac. This turned out to require just 3 commands: $ brew install bash $ sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells' $ chsh -s /usr/local/bin/bash Close the terminal and open… continue reading.

Route specific configuration in Slim

Note: This article was updated on 14 October 2019 to cover Slim 4 in additional to Slim 3. A friend emailed me recently asking about route specific configuration in Slim. He wants to be able to set properties when creating the route that he can pick up when the route is matched. The way to do this is using route arguments. I've written about route arguments before in the context of setting default values for… continue reading.

Migrating to password_verify

I've recently been updating a website that was written a long time ago that has not been touched in a meaningful way in many years. In addition to the actual work I was asked to do, I took the opportunity to update the password hashing routines. This site is so old that the passwords are stored using MD5 hashes and that's not really good enough today, so I included updating to bcrypt hashing with password_hash()… continue reading.

Replacing a built-in PHP function when testing a component

Recently I needed to test part of Slim that uses the built-in PHP functions header() and headers_sent(). To do this, I took advantage of PHP's namespace resolution rules where it will find a function within the same namespace first before finding one with the same name in the global namespace. The idea of how to do this came courtesy of Matthew Weier O'Phinney where this approach is used for similar testing in Zend-Diactoros. This is… continue reading.