Sep 06, 2015

A tiny service for checking if your app is online

Sometimes your app needs to check if it has access to the wider internet, as opposed to some WiFi network that’s redirecting all requests to a sign-in page. There are a few ways of doing this, but this article isn’t about that. This article is about a new tiny service I just launched called “Am I Online?”.

I never really needed this feature myself, but I wanted to try out Heroku and decided this is a perfect way of doing it. The entire application is 9 lines of Python code (using Flask), and about 30 lines of HTML ...

- read more -
Apr 27, 2015

A minimal Pomodoro-style timer

Yesterday I decided to make a very minimal Pomodoro-style timer to keep me on track. It doesn’t offer too many features; it just gives you options for the lengths of time, and 3 buttons to control the timer. If you want to reset the timer, just refresh the page.

It’s available here:


When I said this was very minimal, I didn’t mean just the interface; the code is very minimal too. There are no dependencies; all necessary code is within the one timer.html file. Just put it on a flash drive and ...

- read more -
Apr 11, 2015

NGINX Reverse Proxy for ZNC

If you want to have the ZNC web interface behind NGINX (maybe you want to specify a different server name), this is how to do it.

Firstly, you want to create a NGINX config file. I’ve got ZNC running on the same server, so I use the following config file:

server {
    listen 443;

    location / {
        proxy_set_header    Host              $host;
        proxy_set_header    X-Real-IP         $remote_addr;
        proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;

If you only do this, however, ZNC will complain about the X-* headers. You can remove those headers, but then it’ll think you’re ...

- read more -
Mar 25, 2015

Mirroring a Git Repository

For the past couple of years, I’ve been mirroring repositories locally so that I always have the code accessible even without Internet access. When I saw that FoundationDB’s GitHub account was wiped when Apple bought them, I figured other people might be interested in mirroring repositories, too.

I currently mirror Git, Mercurial and Subversion repositories, but here I’ll just focus on how to mirror Git. The other two will be separate articles.

How to do it

First, you want to do the initial clone. This is slightly different than a regular clone because you want to get ...

- read more -
Mar 22, 2015

How Pocket Parses Titles

Based on a few trials, and looking at many other people’s sites, I think I figured out how to get Pocket to show the correct title when people add your article to the app.

It figures out where the article is (I use <article>), but initially it didn’t realize that the <h1> within the article <header> was the title of the article. This seemed to be because the nav bar also had an <h1> (because I copied a Foundation example), as did the banner at the top of the page. These extra top level headers confused Pockets, so ...

- read more -
Page 1 of 9