Code

  1. Blocking bots by UserAgent in dokku using nginx

    The problem A website I ran was being aggresively scraped by someone using a particular UserAgent string. It wasn't a normal search engine or similar bot (e.g. GoogleBot) so adding something to robots.txt wasn't going to work. This site is using dokku to serve the web app, dokku …
  2. Better horizontal bar charts with plotly

    I often find that horizontal bar charts are a great way of visualising comparisons between different categories. They're easy to understand and make, and provide a really simple way of displaying data. But I've found the default way of labelling them often doesn't make sense. Labels for the bars are …
  3. A map of World Cup stadia using wikidata

    Wikidata is an amazing project that aims to turn the unstructured text of Wikipedia into a database of facts and figures that allows you to go beyond just presenting a page about something to using data about it. I've been wanting to try out using it, and "SPARQL", the language …
  4. Acrostic football league tables

    Following from a question to the Guardian's "The Knowledge" column I've tried to find a longer acrostic than "TABLE". “Has there ever been a longer acrostic spelled out in a table than the oft-recurring ‘TABLE’ from the Premier League this season – or ‘LAWNS’ from League Two?” asks Marco Jackson. To …
  5. Development version of WordPress on Windows 10

    The problem: I need a local development version of WordPress to help test problems with the live site and also test updates. Previously I’ve used WAMP but that tends to get a bit messy, particularly on Windows 10. The solution: use docker to create a container with all the …