Abe Voelker Programming stuff, mainly

Adding Elm to a Rails application

8 minute read

Elm logo

Update: This tutorial was written before Rails 5.1 was released with integrated Webpack support, which makes this whole process much simpler. If you’re using Rails 5.1+, check out this tutorial instead.

Recently I added Elm to a Rails application using webpack, and it took me a while to figure out as I’m new to both so I figured I’d share what I did.

A complete example app is available on GitHub (abevoelker/rails-elm-example); this post will walk through each step used to create it.

Read more

Simple transactional email links using JSON Web Tokens (JWT)

15 minute read

JWT logo

Recently I ran into an issue with a Rails web application where I wanted to add one-click unsubscribe links to transactional emails I send out. This website tracks the inventory of retail product websites; users subscribe to individual products and get notified via email when the price or stock status changes so that they can quickly make purchasing decisions based on the information.

Read more

You got Haskell in my Ruby! Cleaner Ruby validations using the Either monad and Kleisli gem

17 minute read

You got Haskell in my Ruby!

Alternate title: “You could have invented Either!”

Update: It came to my attention from some Reddit comments that the simple example I use in this article is probably not the best for showing off a good use case of the kleisli gem as the “naive” code can be simplified. Therefore, I will be updating this post in the future with a more thorough example. In the meantime, I’d encourage you to read the article “Cleaner, safer Ruby API clients with Kleisli” by the kleisli gem author which has a more comprehensive use case!

I’m still a rank beginner at Haskell, but I guess it’s already leaving some tracks in my brain as I find myself wanting algebraic data types and pattern matching when I’m writing Ruby.

Read more

Why I don't use Docker much anymore

17 minute read

The Grounding of MV Rena

Update: The conclusion of this post talks about managing Docker kittens with Ansible; I no longer do that, but instead use Amazon ECS with Terraform. Docker has stabilized a lot since my early experiences as well. However some things like custom kernel parameters (e.g. for Redis) will always be a limitation. I’ll write a new blog post on how I use ECS and Terraform soon.

When I first started using Docker about a year ago for developing Rails applications, I had dreams of using it across all development environments (development/test through production) and in all related services (linked containers consisting of application servers, databases, in-memory caches, search indexes, etc.). I mean, why wouldn’t you - not only would you get more thorough guarantees of your code and systems matching what production’s running, but you are getting the high performance of containers over VMs when developing! And a year ago it seemed like it wouldn’t be long until the problem of easily deploying these linked containers across multiple hosts would be solved.

Read more