How to quickly spin up a Rails app on an EC2 instance

I’m working with a company that has many Rails apps on a single large server. They want to move to a single app per server model to minimise the blast radius if something goes wrong. They don’t want to have a complicated AMI build pipeline and they’re not at the stage where containers and Kubernetes is something they would feel comfortable running.

So I decided to experiment and find the quickest way to start an EC2 instance and boot a Rails app.

Continue reading →

Create distraction “speed bumps” to stay focused

Have you ever found yourself working away, getting lots done, and then something breaks your concentration and you find yourself doing something non-productive instead of re-focusing?

This has happened to me a lot! I found myself opening Twitter, almost on autopilot, and losing half an hour to doom scrolling before being able to get back to what I was doing.

I’ve made some simple changes to make it harder to accidentally switch focus and help me stay on target and I’d like to share them.

Continue reading →

I want to hear about your customers not your idea

As a developer attending a meetup it’s not unusual for someone to approach you with an idea they’re looking for technical help with. If you’re the person with the idea looking to find a developer or co-founder this post is about what I’d like to hear about and why. (Spoiler… it’s not your idea.)

Continue reading →

Rails Generators - What they’re good for and when to use them

Modifying the built in Rails generators or writing your own can help cut down on repetitive work. I’ve found generators most useful in new apps but they can be useful in older code too. This post covers the advantages and disadvantages of generators and provide some tips for when you decide they’re useful to you.

Continue reading →

My Personal Credo

I came across Leading with Character via this Tim Ferris podcast late last year and decided in January to commit to doing the ten minutes a day for ninety days journaling exercise. It’s been great, a real minds eye opener in places that has triggered some deep thinking.

Continue reading →

How to make Elixir’s File.Stream! work with compressed files

From time to time I need to work with largish gzip compressed files in Elixir. Rather than uncompress these externally it’s possible to stream from the compressed files by passing in some options to the File.stream!/3 call.

Continue reading →

Start with hello world and CI/CD

When I decide to make a web app I start with the skeleton the framework generates and get it running through a CI/CD pipeline so it’s deployed and running in production straight from day one.

Continue reading →

I really like Rust’s StructOpt crate

I’ve been playing around with Rust for a while now and recently wrote a little tool that I wanted to run via the CLI. The Command Line Applications in Rust book written by the Rust CLI Working Group pointed me towards StructOpt which I liked using so I thought I’d put a little overview here.

Continue reading →

Deserializing optional date times with Serde

As part of the CLI app I mentioned previously I used Serde to parse a JSON response from a HTTP API. The response has an optional date time value with a custom format. It took a little while for me to figure out how to handle it so I thought I’d write it up here.

Continue reading →

My project idea appraisal process

Like a lot of developers I have folders of half-completed side projects, test projects used to learn about something then abandoned, and a collection of unused domain names bought in the heat of the moment. This is not ideal!

Last year I did a retrospective on a side project I spent too much time on and came up with a set of project appraisal rules for myself I thought I’d write up.

Continue reading →

Secret sharing with maths

I’m currently working my way through Jeremy Kun’s A Programmer’s Introduction to Mathematics. One of the exercises in Chapter 2 asks you to create a web app to implement secret sharing using polynomial interpolation. I went a little overboard and made PolyShare. I put a bit more effort into the app than strictly required to answer the book question and this post goes into some of the details.

Continue reading →

Terraform provisioned static site hosting on AWS S3 with CloudFront

I recently setup a couple of static sites by hand using CloudFront in front of S3 for https. I decided the next time I needed to set one up I’d automate it using Terraform and Terragrunt and this blog post is a brain dump of my notes on that.

Continue reading →

Which Elixir books should I read?

tl;dr: Programming Elixir then Elixir in Action. Skip Programming Elixir if you’re already familiar with functional languages, pattern matching, etc.

Continue reading →

Microconf Europe 2015

MicroConf Europe 2015 was without doubt one of the best conferences I’ve ever attended. The talks were great and so were the conversations with the other attendees. If you’re interested in bootstrapping you should definitely get a ticket to a future one.

Continue reading →

Teaching ember-cli to talk to phoenix sockets

I ran into a little trouble hooking up websockets when playing with an ember-cli front end app and a phoenix backend server recently. I thought I’d document what I did to get them working for others trying this out. I make no claims that this is the best way to do things but it’s working for me so far. If you know a better way please let me know in the comments or by email!

Continue reading →

What are the different OTP supervisor restart strategies useful for?

OTP Supervisors can restart their children in four different ways and to better understand which one to use in a given scenario I wanted to summarise a few patterns I’ve seen.

Continue reading →

Quick Rails 4.2 app setup

I read a great post by Graeme Mathieson that walks through how he sets up a new Rails 4.2 project from scratch. At the bottom of the post he mentions it takes him half an hour or so. I’ve been meaning to play with Rails Application Templates and figured this would be a good opportunity to see what they can do and if they can cut down this boilerplate time.

Continue reading →

Erlang Factory Lite Berlin 2014

Yesterday I went to Erlang Factory Lite in Berlin. It was a great day of presentations and chat about Erlang and Elixir. Highlights for me were hearing José talk about Elixir and chatting with Robert Virding at lunch after seeing his talk on Erlang.

Continue reading →

Why is my test failing when I use cast?

A little while ago Paul Wilson tweeted about some troubles he was having while converting an example from the Erlang and OTP in Action book to Elixir and adding tests. I’d just been doing the same thing and I wanted to expand on my reply to him here.

Continue reading →

Why should I learn Elixir?

I’ve been interested in Elixir since I first came across it in 2013 but didn’t start learning it properly until recently. So why am I learning it now and why do I think you should too?

Continue reading →