Pages tagged “code”
15 Dec 2024
Start your holidays with a meta-alarm
Back in 2022 I wrote about how annoying it is, with all the built-in smarts in a smartphone, they still wake me up even when there are like a hundred ways they could detect that I don’t want to be woken. I now have a solution! If you work, or have children to get to school on time, or otherwise just need to be up and about before you naturally wake up in the morning, you have doubtless got a scheduled, repeating alarm.02 Dec 2024
PGN files from handwritten chess notation
Our family has been playing quite a bit of chess recently. The younger members - initially insistent that all games must be “full chess” - have been persuaded to complete a few exercises with just pawns, practise some end games and get the ideas about planning more than one move ahead. We got a chess puzzle/exercise book and it’s proved a hit. I’m now routinely losing to a 9.5 year old - he has had more practice than his big sister.02 Mar 2021
An escape room for developer teams
I can’t help it: I have an insatiable desire to program computers to do things. My latest hobby project pretty much assumes that others do, too. In response to covid-imposed remoteness, seeing dev teams struggle with coherence and the strain that teams get subjected to in such circumstances, I built a thing. I’d had the idea for a little while, and I might well have missed the boat here (lockdown has been full on, my coding time limited), but hey.11 Jul 2019
What type of typist are you?
Sharing a desk-photo of a diagram I’d drawn for work recently, I noticed the lamentable state of my keyboard in the margin. I can make out the places where my fingers rest when I’m using the keyboard, and the tops of the keys are all shiny and, well, grimy. A forensic investigator could probably glean all sorts of information from the wear patterns (not to mention the crumbs, dust and other detritus).10 Apr 2019
Think twice before you soft delete
This is a code-heavy blog post about a specific pattern/third party library. I wanted to document the behaviours that other Django developers need to expect if they are not super careful when introducing a concept called soft deletion. Soft deletion, on the face of it, is a neat thing to be able to do. Say you have to write an application to track books in a library. You might create a Book model in your database and have a Loan object that refers to it.07 Mar 2019
Tohora - instant web page control for balenaDash
A post introducing a recent hobby project of mine. Last year I changed jobs and stopped working with digital signage. What do you know, though: the office I now sit in, at the super-nice Bradfield Centre, has a display on the wall, so I felt sort of obligated to get something running behind it. Not literally behind it - although a Raspberry Pi is pretty small, it’s proved rather difficult to wedge behind the monitor.16 Jan 2019
First foray into fintech
Challenger banks are quite the thing these days. I am a big fan of both Monzo and Starling. I wrote a python script (publicly available on github) to help me save some of my day-to-day cash into one of Starling’s “spaces” (their word for savings goals). I’ve punched in how much I want to start each month with, and how much I’d like to leave at the end, as a buffer.15 Sep 2014
A utility for photo triage
You know when you’ve shot a grillion photos and you just want to keep the good ones? Here’s a small utility I’ve written to make this easy and quick. It’s for geeks, since it involves the dreaded command line to begin with. Change into a directory full of photos and run a single command triage. Open a web browser and point it to your computer (works nicely from iPad, allowing you to sit on the sofa flipping through photos.12 Aug 2014
Patch updates in pinned Python packages
A post about Python programming with a tongue-twisting title… Most Python projects rely on libraries (packages) from elsewhere, in particular from PyPI. Although it means you have to manually check for new versions of this third-party code, it’s a good idea to explicitly “pin” the version of each dependency, and this is usually done in a file called requirements.txt. This way, you know that what you use in development is the same as what you deploy.06 Jun 2013
Their tables were stored full, to glad the sight
About a year ago I came across a great open source resource: the complete works of William Shakespeare, in an SQL database. I couldn’t resist tinkering with it and got a few things done. What I really wanted was to open up the database so that people could run their own queries on it. Thanks to Webfaction, I’m able to do this now. Click the link below to see what you can do.18 Mar 2013
Crunching the Cloud
The news that Google Reader is to shut down is disappointing. Anyway, it made me think: “what if Google closed down GMail?”. There’s no indication that they plan to, but I don’t like the idea that it might go away one day. So I checked out a few solutions and have downloaded my email using Gmvault. It’s a script that, once you authenticate it with your Google account, merrily churns away, saving your emails into files organised by month.12 Mar 2013
Not all invoices are created equal
This is a post about invoice numbers. Don’t say I didn’t warn you. I started a company recently. Starting a new organisation is an opportunity for certain indulgences: you get to choose a name you take decisions on how things look you get to set things up the way you want As I’ve amply demonstrated already, I like thinking things through (some might call it overthinking). There won’t be many people affected by my invoice numbering scheme, and quite possibly even fewer who are interested, but here are the reasons why I have not gone for just ANG001, ANG002.24 Jan 2013
Digital Spring Cleaning
I heard this quote from my good friend Quentin. A philosophy with which I wholeheartedly agree: “You know you have reached perfection in design, not when there is nothing more to add, but when there is nothing more to be taken away.” Antoine de Saint-Exupery There’s no such thing as a perfect software project, but the results of my day’s work included a net deletion of 5,359 lines of code - satisfying, in a way.26 Nov 2012
Google Refine and the Fotherington-Thomas issue
If you ever work with spreadsheets (!) you no doubt keep your data meticulously clean. I bet you never ever enter “n/a” into a column that’s otherwise full of numbers, or mix “U.K.” with “United Kingdom”. Today’s news flash: there are spreadsheets out there not created by people like you and me. People who, late at night, mistakenly copy columns and accidentally transpose the data, or make typos and don’t spot them.08 Oct 2012