-
Planets and Webhooks: a simple Flask app
22 July 2020
Read moreAs a Developer Advocate for an API company, I spend a lot of time talking about APIs and webhooks and HTTP in general. Recently I've been focussing on HTTP tools, but I really wanted a very simple example API that I could use that would return JSON but really let me focus on the tools, not the API. So I created a "Planets and Webhooks" API with a couple of GET endpoints to return JSON data, and another endpoint to receive and log incoming webhook data.
-
Neopixel Shelf
18 July 2020
Read moreIn these days of video calling in place of any other social contact, I've seen a lot of excellent video backgrounds. Perhaps I'm old-fashioned but I went the traditional route, and set up my computer close to a wall (so you can't see the mess in the room) and added a nice pinboard behind me. I looked a bit flat against the wall though, so I did what anyone else would do ... and built a handmade wooden shelf with neopixels in it!

-
Add a Screenshot Button to Streamdeck with Golang
06 July 2020
Read moreI'm the proud owner of a Streamdeck XL but as an Ubuntu user, the tool support isn't great. There's a Python library that gives a bit of a GUI but I found it hard to use and I'd have needed to put each piece of functionality as a commandline script that this program could call. Instead, I am using go-streamdeck to create a custom application - and I'm having fun! Today's example adds a single button that runs a command to take a screenshot.
-
Accessing Nested Config with Viper
25 June 2020
Read moreI'm writing a Go application that glues together a bunch of other things, so it has a whole bunch of basically unrelated config, dumped in a yaml file. I was struggling a little with this non-standard use of Viper but actually, it does everything I needed. And, presumaby, more besides. I thought I would put some examples here to show how to handle this.
-
Use a Local Version of a Library in Go
15 June 2020
Read moreI have a couple of projects in Go where I need to work with a branch that isn't the released version of a library that my code depends on. This happens when I'm the developer of the library and an application to use it, or when I'm a contributor to the library so I have my own fork and will want to check out branches to submit or test patches. Go has a pretty need way to allow this: using the replace keyword in the go.mod file.
-
OBS Studio, Ubuntu 20.04 and a Wacom Tablet
31 May 2020
Read moreWhen I upgraded my computers to Ubuntu 20.04, I noticed a weird problem with OBS when using an old Wacom Bamboo tablet (because, have you ever tried to use OBS without a pointing device?). I couldn't actually click anything! The pointer seemed to be ... pointing to the wrong place …
-
Eye Contact Owl
26 May 2020
Read moreI don't post as much handicraft on this blog as I used to (it's mostly on my instagram account with fewer words now), but I wanted to share my new handmade owl. He solves a genuine problem: how to make eye contact with your webcam.
-
Custom OpenAPI Style Rules with Spectral
21 May 2020
Read moreEdit: There's a newer post on this topic using Redocly CLI.
I work quite a bit with OpenAPI specs and with lots of specs and lots of collaborators, keeping the specs all functional (never mind tidy, consistent, or other dreamwords) is a challenge! We use spectral to check our specs, both when we work on them and in the build process. Spectral is great but it has Opinions(TM)!
For most users, running Spectral out of the box gives quite a lot of output even on an otherwise valid spec. I do think the default ruleset for Spectral is pretty good, but every situation is different so having your own ruleset to use is a good idea. This post shows how to use a ruleset and some examples.
-
The python-is-python2 package on Ubuntu Focal Fossa
24 April 2020
Read moreI did a fresh install of Ubuntu 20.04 Focal Fossa on my laptop, and was surprised at what happened when I went to install python:
$ sudo apt install python Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'python-is-python2' instead of 'python'
Um, what?
It …
-
A First Netlify Function in Golang
15 April 2020
Read moreI love all things serverless, and Netlify Functions is a neat and convenient way to access AWS Lambda. I do also love AWS Lambda but it's so powerful and flexible that creating something like a webhook receiver can be hard going by the time you have all the permissions and API Gateway setup sorted out - for a simple webhook receiver, Netlify functions is a nice and easy way to get going. Best of all: it supports Golang but the docs are very JS-heavy so I am writing my notes here in case I need to refer back to them some day.
-
Wget Direct to S3 with Golang Streams
08 April 2020
Read moreOne thing I find very elegant about working with golang is that it is very open minded about where data is flowing in from or going out to. I recently built an application that downloaded an audio file from one location and pushed it to s3 - and golang makes it very easy to do that without needing to write an intermediate file and then upload that. Here's my code, in case I need to do this again some day :)
-
HTTPMock for Testing a Golang API Client
30 March 2020
Read moreI'm working on an API client for some Nexmo APIs and having tests to work through the various responses that the API can return and check that it does what I expect has been very handy so I thought I'd share my thoughts. I've got a bit of a head start here too since the OpenAPI specs have example responses in them that I can grab and feed to the mocking tool I'm using in my tests!