1. Ubuntu 14.04 Setup for Rails and Ember with i3

    Recently I switched to Ubuntu 14.04 for my work machine. I develop both Rails and Ember applications. Here was my latest setup process, which provides i3 and a few extras. Note that I have an Nvidia GTX760 card and a Samsung 512Gb SSD. 1. Ubuntu base 1. Download the…


  2. Terminator Launcher for Ubuntu

    Death of a Mini I recently moved from Yosemite to an Ubuntu machine. My Mac Mini had 16Gb of Ram and kept running out of memory on Yosemite. I wasn't even running anything heavy most of the time. Something was not right. The last straw came when I bought a…


  3. New Pluralsight Course: Rails Rendering

    A Deep Dive Have you wanted to get a better grasp of the Rails code? In particular, do you want to create your own Rails renderer or resolver? What the heck is the difference between a template handler and a custom renderer anyway? If you answer yes to any of…


  4. Serving Multi-file Zips with Rails

    The Prob Suppose you are have an Axlsx report served with axlsx_rails, and you need to generate it for multiple models, and serve them all in one request. You can't simply call render for each: def download_report params[:user_id].each do |user_id| @user = User.find user…


  5. Rendering a Rails View from a Script

    The Problem Sometimes you want to render a template inside of a script. Suppose you need to cache the generated output, say a web page or a spreadsheet, and save it to disk. So how do we do this? It is of course easy to do inside a controller. Call…


  6. ActiveRecord#freeze

    Blissful Ignorance I have an ActiveRecord model that saves the going Canadian exchange rate when needed. I (in)conveniently called that method freeze: def freeze if unit_order unit_order.set_freight if Maybe(unit_order.dealer).canadian? unit_order.set_exchange_rate(true) end unit_order.save end end…