Developing software in the Real World

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:

As I use MarsEdit to write my posts, I created a Media Markup Template that does the heavy… 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.

Using a separate master password in 1Password for Mac

I really like the 1Password password manager and recently switched to using the subscription based account. This allows access to my passwords via the web so, as you can imagine, I have a very strong 35 character master password set. On my Mac, I use the 1Password app and that requires me to enter my master password reasonably frequently, so this very long password is not so desirable here. I'm comfortable that a 12 character… continue reading.

Keyboard shortcut to Save as PDF on Mac

I regularly print to PDF on my Mac, This is done from the print dialog by selecting Save as PDF from the drop down in the bottom left of the dialog which is a bit of a pain to get using the mouse. I recently discovered that I could create a keyboard shortcut to make this much easier. In System Preferences -> Keyboard -> Shortcuts -> App Shortcuts you can create a keyboard shortcut to… 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.

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:

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 you… continue reading.

Using .vimrc for project specific settings

I'm more of a spaces person than a tabs person when it comes to source code and in Vim, I like to see the tab characters, so I have this setting:

This places a handy ⇥ character so that I can see the tabs: I'm currently working on a codebase where the coding style is to use tabs, so I need to change my settings. One option is to use EditorConfig, for the formatting… continue reading.

Run the UniFi Controller headless on Mac

I'm running a UniFi network here with wireless access points, the Security Gateway and a PoE switch. It seems to be a robust system and is almost certainly overkill, but reliability is high on my lists after bad experiences with a NetGear WiFi router. The UniFi system software is called the Controller and runs on a various operating systems. As I have a Mac mini here, I decided to run it on there. Weirdly, however… continue reading.

Using ngrok to test on a mobile

To test a website that you're developing on your local computer on a mobile device such as a phone or tablet use ngrok. This is the way to do it: Start up ngrok: $ ngrok http my-dev-site.local:80 This will start up ngrok and give you a "Forwarding" URL such as http://24f55bf5.ngrok.io. In this case, it will direct all traffic to that URL to http://my-dev-site.local. If you run your website on a different port, such as… continue reading.

Hide the ST3 sidebar automatically

As a mostly keyboard user, I take advantage of the keyboard shortcuts in Sublime Text. However, the sidebar is quite a lot of effort to manage, especially as I mostly leave it closed. Firstly, you need cmd+k,cmd+b to open it. Then you type ctrl+k,ctrl+0 to focus it as opening it doesn't automatically set focus. Then you can navigate to the file you want and open it via pressing return. Finally, you type cmd+k,cmd+b to close… continue reading.