Never miss a beat

Join my newsletter.

The Archives

Generating HTML from a List in Elm

Published: 6/27/2019

Elm is a fantastic language for building web applications. It provides a rich DSL for writing HTML that functions in a similar way to JSX (but still quite different). Overall, I enjoy writing it, however, I often forget how to generate HTML from a list of data in Elm. Indeed, the problem is not that difficult, and once you approach it from a functional mindset, it’s easy to see how it works. A simple, yet somewhat contrived example, can be found below: You’ll notice a couple of things: Our Model…

Prompt the user for a rune at the terminal in Go

Published: 6/13/2019

I’ve been spending a lot of my spare time working on a Go project called Deckard . It’s a command line interface (or CLI) for handling database schema changes. Recently, I found myself wanting to prompt the user for a rune before running a command in that CLI. Why would I do this? Deckard handles schema changes via the migrations pattern . This consists of having an up migration and a down migration. The up migration might be to add a new table or alter a column, while a down migration…

Your application should not be responsible for Database Migrations.

Published: 6/9/2019

Classic database/schema migration patterns are a nightmare for modern systems. As Software Engineers push for a more distributed ecosystem, one is tempted to ask: “Why should the code that manages one system, live with the application code of another system?” My first exposure to this pattern was with Rails in 2013. With Rails/ActiveRecord, when your application boots up it checks the database schema against a list of schema changes you’ve defined and ensures the database meets those…

List Processes by Memory Usage in Linux

Published: 5/9/2019

I recently was running into an issue where a Systemd service was crashing due to an out of memory error. I was pretty sure that my project wasn’t taking up too much memory, but I wasn’t certain what was. Thankfully, with the use of some command-line wizardry, I was able to find out that Hyper (the terminal app) was using almost 3gb of memory! We have two commands here, each with their own man page should you want to learn more. The first command is ps which displays information about all…

What Is Gradle Scan?

Published: 4/17/2019

A Gradle scan is a build scan that provides insights into how your build ran and why it did what it did. Once you’ve generated a scan, you can share that with other members of your team (or anyone who may help diagnose issues) via a URL. Here’s a sample scan ! Scans are supported with Gradle 4.3+ out of the box. Most new projects are going to be using this, but you may need to update OR install the Gradle Scan plugin in your existing project. Creating a Gradle Scan Creating a Gradle scan is…

Setting Up Sentry Logging with Scala / Play

Published: 4/16/2019

Sentry is an error tracking service that helps you quickly track errors in many environments. While it’s not the only option for error reporting ( Rollbar comes to mind since they sponsor most of the podcasts I listen to), Sentry is my favorite option. Today, we’re going to setup Sentry reporting for our Scala / Play application. The Play framework is a web framework for building predictable and scalable applications. Featuring support for Java and Scala, the Play framework is a great…