March 31, 2023

One month with Github Copilot

I’ve been trialling Github Copilot for some weeks now, and so far I’ve been very impressed. It’s clear to me that this and similar tools will become a permanent part of many programmers’ toolkits (at least until the AI gets so clever that it obviates our jobs completely).

Read more »

July 26, 2020

Transitioning Later for Reddit from Docker Machines to Digital Ocean Kubernetes

I recently completed a migration from my old docker-machine-based infrastructure (so 2016!) to Digital Ocean’s hosted kubernetes service. The bulk of the work was completed in a single evening. It went almost seamlessly, but not so seamlessly that I wasn’t able to learn a few things. The goal of this writeup is not to serve as comprehensive documentation, but hopefully you’ll take away some ideas about how to get your own setup rolling.

Read more »

December 17, 2018

Getting a handle on Reduce

Although traditional algol-inspired languages remain dominant, over the past decade or so, functional programming techniques utilizing immutable data structures have seen widespread adoption in a variety of domains. From React and friends on the frontend to Map-Reduce and the vast ecosystem of thus-inspired data warehousing systems that power some of the world’s largest software applications, the ability to navigate such applications is now a must-have skill for many programmers.

The subject of today’s article is a higher-order function called reduce, also known as fold, aggregate, and others. Reduce is a fundamentally useful tool, but I find that many developers have trouble grasping and using it. My hope here is to make an approachable introduction to reduce.

Read more »

May 23, 2018

Programatically Liquidating my Steam Inventory

I don’t know about you, but every so often my Steam Inventory gets a bit out of control. I have no use for Don’t Starve trading cards, but it’s not really worth my time to individually sell each item for a few cents. However, what is worth my time, apparently, is creating a script to do it for me. This turned out to be quite a winding road, which I’ve documented here.

Read more »

February 18, 2018

One-box stream processing with CSP

If you’re like me (that is, employed by an ad tech company), stream processing is usually associated with frameworks like Storm, Flink, Spark Streaming, and other such solutions. However, a lot of real-life software can be described as stream processing – data comes in one end, is transformed or aggregated, and goes somewhere else. Many of these workloads don’t justify the overhead of a stream processor, but that doesn’t mean they can’t benefit from some of the lessons of stream processing systems.

Read more »

December 19, 2017

Running a Side Business as a Programmer: The story of Later for Reddit

For the past 5 years, I’ve run a website called Later for Reddit. For the past 2 years, it’s actually been making money. Here’s how that happened. I used to spend a lot of time on Reddit (insert Mitch Hedberg joke here). I also used to spend a lot of time writing side projects, often late into the night. One problem I frequently had at the intersection of those two hobbies was that, when I posted my sweet new thing to Reddit after I finished getting it ready at 2am, it never had a chance of getting seen.

Read more »

September 16, 2017

Javascript FP design pattern: Binding functions

Ok, ok, monads have been done. They’ve even been done by me before. But, functional programming is still popular, monads are still very useful for programming in an FP style, and people are entering the field every day. So here’s another attempt at an approachable introduction to usefully apply this pattern to everyday coding problems.

Read more »

September 3, 2017

Bucklescript vs Elm vs Typescript: Typed Javascript showdown!

You, a web developer, have probably heard of Typescript, may have heard of Elm, and you might even have heard of Bucklescript/ReasonML as well. Each of these represents a compiles-to-javascript language with strong type support, but each has some different opinions, philosophies, and features.

In this article I’ll walk you through the features of each of these options and compare their build ecosystems, editor tooling, and javascript interop. In addition, as is my habit, I’ve written up a small example in each of these languages. (Well, actually, I’ve taken one of Elm’s small demos and re-created it in the other two). I’ll discuss my impressions of the tooling and the coding experience along the way.

Read more »

August 28, 2017

OCaml for the impatient

Ocaml is a rad language with some regrettably underdocumented parts. Or, perhaps, overdocumented – since OCaml attracts people who are interested in rigorous correctness, what documentation exists tends to be rigorous and correct, and also tedious. This guide will be none of those. Let’s go!

Read more »

August 13, 2017

Best Practices for Javascript Library Versioning

I spend most of my time on this blog talking about Clojure, but IRL I work on a lot of projects written in a lot of languages. Lately, much of my time has been spent writing and maintaining React-based frontends in Javascript.

As far as I can tell, no language has solved the problem of dependency management. Some libraries are better than others, but upgrading dependencies is always an uncomfortable experience. That being said, I’ve never experienced more pain doing so than in Javascript’s ecosystem.

Read more »

August 6, 2017

Domain modelling with clojure.spec

Clojure.spec is, among other things, Clojure’s official answer to tools like Typed Clojure and Plumatic’s Schema. It represents an attempt to apply some validation to data and functions, without compromising Clojure’s dynamism and data-is-data philosophy. In this post, I’ll be working through a sample program by first outlining and modelling it with the help of clojure.spec, then using spec to guide me while I develop the implementation.

Read more »

November 4, 2016

On Advice (featuring just one piece of it)

I’m perfectly comfortable making wild assertions about which programming technique is better than which other one, but when it comes to handing out general life or career advice, I’m a lot stingier than your average blogger 1. Even if I was wildly successful (I’m not), it’s so difficult to tell, even in retrospect, the difference between the stuff that actually mattered and the stuff that seems like it did but doesn’t 2.

Read more »

August 23, 2016

Basic site monitoring with Riemann

Riemann is a general-purpose event processing system, but its most typical application is as a place to send and generate metrics about applications. I recently set up a Riemann server for my personal projects, and I feel like my devops game is stepped up by 1000%.

Or, at very least, I feel like I know know about it as soon as one of my sites goes down.

Read more »

April 15, 2016

What’s in a namespace?

Every well-behaved clojure source file starts with a namespace declaration. The ns macro, as we all know, is responsible for declaring the namespace to which the definitions in the rest of the file belong, and generally also includes some requirements and imports and whatnot. But today (at Clojure/West, shoutout!) Stuart Sierra made a passing reference to the internals of ns during his talk that got me interested.

But what is a namespace really?

Read more »

March 29, 2016

Write and deploy your own self-hosted Readability clone

Readability.org is a handy tool, but it also suffers from being useful, popular and free – the service is (understandably) often down, or slow. If you’re a heavy Readability user, it might interest you to know that there exist many software libraries that attempt to recreate Readability’s main function – pulling the main body of text out of a page laden with ads and other distractions. Some of these work better than others, but Mozilla’s Readability.

Read more »

March 27, 2016

Composible Architecture: A real-world example.

I am the primary maintainer of a significant REST API written using Flask-Restful. Flask-Restful is a pretty full-featured library for creating REST frameworks with Flask. It features everything you need to manage routing to class-based resources, a library for marshalling objects to JSON format, and reqparse, an argparse-inspired library for writing input parsers.

Read more »

March 26, 2016

React.js in the small

I’m a big fan of accessible technologies. I get suspicious whenever I encounter a framework or library that is “not worth it for a small project,” because that is a coded statement that means either “It has a broad scope of features that a small project won’t take advantage of,” or “it trades off simplicity or user experience for performance or other reasons.” Accessibility also helps open-source projects move from obscure to ubiquitous; if jQuery had required a command-line tool to compile it when it came out, I can practically guarantee you wouldn’t have ever heard about it.

Read more »

March 19, 2016

The Web is (finally) a mature platform

I started my career as a “web developer” circa 2007. I’d dabbled before with Javascript while making sites in HTML/CSS as early as middle school, but that was my first real job as a real software developer. Back in those days, LAMP (Linux/Apache/MySQL/PHP) was about the only sensible way to build a web application. You could use Java servlets, of course, or build applications using CGI, but once PHP was stable and available and straightforward, and it quickly became the obvious choice for a huge range of applications.

Read more »

February 28, 2016

Clojure SQL Migration Libaries

It is generally recommended, if you’re developing an application that uses a database, that you manage changes to the schema of said database using some sort of migration system or another. Luckily, several intrepid developers in the clojure community have stepped up with their own solutions to this problem – all of which end up being very similar indeed. Read on for an overview of your options and to find out which one is right for you.

Read more »