by Matt Brennan

Sourcing a shell script in Make

Let’s say you have a makefile, and you already have a shell script (probably called something like that you source before running your app to set environment variables in it. Now you’re writing tests (run by Make), and you need your environment variables there, too. “Aha”, you think, “I’ll source the env script in a makefile variable”:

DUMMY_ENV := $(shell source

Well, that doesn’t work. Make runs its commands in a subshell, so the variables exported by source aren’t available to other commands.

Read more…
by Matt Brennan

Taking a flamethrower to my Github repositories

Two hours ago, I had just shy of 300 repositories on Github. As of now, I have less than 90, and I’m not even sure I want to keep all those. So what up with that?

Read more…
by Matt Brennan

Stepford: a Smile Online Banking scraper

It is a truth universally acknowleged that online banking websites are shit. Smile, for example. If you’re so infelicitous as to press the back button, or reload, or open a link in a new tab because that’s how HTTP is supposed to fucking work it logs you out. And apologises (sneeringly). If, on the login screen, you start typing your sort code, it “logs you out”. Because reasons. The less I have to deal with the website, the better my general mental health seems (although I’ll admit there are confounding factors here).

I’ve also been trying to solve the problem of “whoops, where’d my money go” the only way I know how: throw a bunch of Javascript at it. Do science. Well, it generally helps when processing data, e.g. bank transactions, to actually have a machine-readable version of the data, and of course Smile doesn’t have an API.

Read more…
by Matt Brennan

"Ugh, I'm ill and I need barbecue sauce like right now" barbecue sauce

by Matt Brennan

Election results scraper

Spoiler warning: it wasn’t. Not all of it. So, I wrote a scraper to grab it from the BBC website (sorry, Auntie Beeb!).

Now, for mad electoral science.

The boring bits, unless they’re the interesting bits

Request for the HTTP, Cheerio for parsing and extracting, Numeral.js as the sledgehammer to crack 10,000-format numbers, Highland and JSONStream to glue things together.

by Matt Brennan

Fun with malicious email attachments

So, I got an email purporting to be from “FedEx International Economy”, a “Delivery Notification”. “Hmm.”, I thought. “What have I ordered? Waaait a minute…”

Attached was a zip. In the zip, a heavily obfuscated Javascript file.

Read more…
by Matt Brennan

Github releases atom feed

So, I found myself wanting to automate the “shameless plug” stage of releasing open source software. npm doesn’t (yet) have feeds for updates and releases, so that left Github. It’s got feeds for releases of each particular repo, and a firehose of a user’s public activity, but nothing in between. Until now.

Read more…
by Matt Brennan

Minimum Viable Productivity

You’ve been there. The crushing weight of your to-do list. The Twitter → Facebook → Reddit loop. The existential despair.

Ask yourself:

What’s the least I can do to be productive?

- You


Whittle down your inbox? Great. Do it.

Wash up that one pot that’s taking up the entire worksurface? It’s not even that dirty.

Pump your bike tyres up? Reply to that bug report? Commit a one-line fix? Easy.

Suddenly, everything seems not so bad after all. Everything flows that bit easier. It’s like the foot-in-the-door sales technique, except for good not evil.

by Matt Brennan

Risk dice

I made a thing. It rolls dice so you don’t have to. It lets you throw Risk battles with ludicrous numbers of dice, which probably speeds the game up.

It’s a library:

<pre>npm install risk-dice</pre>

And an app.

by Matt Brennan

Chinese Barbecue Pork

I still can’t believe how good this pork turned out. So, we get a fortnightly box of organic meat from Abel & Cole. And it’s delicious, but then every so often we get pork steaks, and end up turning them into something resembling shoe leather with paprika. Now, don’t get me wrong, it’s damn good shoe leather. Turns out I could do better.

This takes half an hour to cook but the pork’s juicier if you marinate it for a couple of hours (or even overnight). Plan accordingly.

Read more…
by Matt Brennan


In this manual will be found a description of the construction of the camera, and the simple instructions necessary to operate the instrument. The manual does not purport to be a treatise on twin-lens photography but we hope that the information provided will prove of value to the newcomers to twin-lens photography and enable them from the very commencement to produce first class negatives.

by Matt Brennan

Livewire 0.6 released

Livewire 0.6 has been released, containing a breaking change: HTTP request body parsing is no longer included in the core. It’s been split out into its own module, Corps, rebuilt on plain Highland, and gained a new feature: content type sniffing.

by Matt Brennan

Building a simple REST API with Livewire

This post is adapted from Modulus’ excellent introduction to HAPI.

I might have mentioned Livewire around here a couple of times. Livewire is my little (and getting littler) HTTP router with a functional bent, for Node.js. Since 0.5, released this weekend, it’s been based on Highland, a high-level streams library.

Read more…
by Matt Brennan


I’m pretty psyched about this. First, some background. As you may know, I’ve been working on an MVC framework on and off for the last four years. Mostly off. It’s called Gusto, apart from when it’s called Struct or Juego. It’s never been anywhere close to ready, and in the last four years I’ve kind of grown up as a programmer and gotten a bit disillusioned with the whole MVC thing. Also frameworks. So fuck MVC. Also frameworks. And that’s a blog post for another time.

Read more…
by Matt Brennan


Welp, that’s twice in a week it’s rained for exactly 15 minutes, starting as soon as I get on my bike and ending when I get off.

Don’t cycle in the rain, kids.

  1. You get wet.
  2. Really wet.
  3. You can’t see.
  4. No-one can see you.
  5. Your brakes hardly work.
  6. Your bell doesn’t work.
  7. It’s cold.
  8. It’s dark.
  9. You get wet.
  10. You’re the only one with a mudguard, so you get sprayed anyway.
  11. Umbrellas.

I’m just going to sit here and steam slightly.