Josh W Lewis Josh W Lewis / Essays

Deploying Phoenix Framework Apps to Heroku

By Josh

On July 11, 2015

I’ve been toying around with the Phoenix Framework lately, and I wanted to get something out in the wild. Getting it up and running on Heroku’s free tier seemed like the simplest place to start.

Heroku doesn’t officially support Elixir (or Erlang...

Rails Unit Measurement Persistence

By Josh

On March 9, 2014

I’ve worked on a few apps in the past that had some cumbersome constraints in regards to the units of measurement. Models needed to store heat transfer or fluid dynamics properties in either english or SI units. This is can be a bit of a pain, so I...

Unitwise: Ruby Unit Measurement Math and Conversion

By Josh

On August 13, 2013

So, way back in Mechanical Engineering school, I learned that a very effective way to check my answers was to make sure the units worked out. For an example, consider a basic physics problem:

The average mass of an adult American male is 86 kilograms...

Rails' ActiveSupport try

By Josh

On April 26, 2013

ActiveSupport has a few great Ruby extensions that I just love. One of my favorites is try.


Try is a sneaky method for handling NoMethodErrors on NilClass. If you ever get stuck writing code like this:

name = unless user.nil?


Rails Flash Messages with Twitter Bootstrap

By Josh

On March 2, 2013

When building new Rails projects, I often use Bootstrap because it lets me focus more on the business logic, rather than design. Almost everytime I start one of these projects, I forget how I did flash messages the last time, and have to look at a...

Static Site Creation with Middleman

By Josh

On February 10, 2013

I’ve put off building my personal website for a while. I’m a Rails developer, so it would be fairly straight forward to build a blogging application and host it somewhere. But, that seemed like a lot of overhead – content management system, database...