1. 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…


  2. 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…


  3. 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…


  4. 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…


  5. 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…


  6. Prawn: Turning Tables Part 2

    This is the second post in a series on my changes to Prawn to support rotated table text. Prawn is a fast ruby gem for creating acrobat files. I use it to create reports and invoices. However, it does not have support yet for rotating table text. View the last…