Blog
A dumping ground for my thoughts, code explanations, and rants.
Bulk removing transparency from a folder of PNG files
Wed, 13 September 2017Removing transparency from a single PNG file is easy enough, but what about when you have a folder of hundreds?Thankfully, there's a quick tool to help this along.First, install imagemagick with brew:$ brew install imagemagick Once that's installed, navigate into the folder that holds the PNG image... read more
Checking .to (Tonga) Domain Availablility
Tue, 02 May 2017The .to TLD is a very attractive one, however, automating the whois for it is somewhat a pain. It appears their public whois server is often down.I've written this short Python snippet to check availability:import urllib2 def is_available(name): response = urllib2.urlopen('https://www.toni... read more
Handling the many favicons on Google App Engine
Sun, 05 March 2017It used to be just a simple favicon.ico file that you had to worry about, but more recently other formats have been creeping in. Instead of adding a huge number of handlers into your app.yaml, you can simply use this snippet (after any other image / resource references):- url: /(.*\.(ico|png|json|xm... read more
Validating Google's reCAPTCHA on App Engine with Python
Sun, 20 November 2016Google have seriously revamped their reCAPTCHA recently. And it's awesome. Running this on App Engine for comments on blog posts or whatever else you need it for is quite simple.I wrote this small Python class to help verifying the results:import urllib2 import urllib import json class ReCapt... read more
Deleting a tag from git (even after pushing)
Sun, 06 November 2016We've all been there. You've made a mistake and somehow managed to push up a tag that shouldn't be in git. Thankfully, deleting a git tag (including on the remote) is fairly easy.First, delete the tag locally:$ git tag -d my_boo_boo_tag Now, simply let the remote know about the delete:$ git push or... read more
Admin areas are just easier with Google App Engine
Sun, 09 October 2016Before reading on, take note that quite often you need your own system. This isn't a catchall solution, but for basic administrative systems, this is great.We've all made numerous admin systems. And for most of us, it's something of a chore. Not least because it takes ages to put a decent login syst... read more