Hi, everyone!
I hope to see you tonight (or any Thursday) between 6 and 8 PM!
I haven't written in a couple of weeks. Here's what we've been learning:
-
Foreman The Foreman gem is a little different from most of the gems you use. Foreman was created for use with Heroku applications but can in fact be used in other environments (including your dev environment). In a nutshell, Foreman allows you to pass a set of instructions to Heroku telling it how to run your processes (web server, background worker, etc...). The set of instructions is written in a
Procfile
. Heroku details how to write yourProcfile
depending on the web server you're using. You can always test out yourProcfile
locally by installing Foreman usinggem install
(not yourGemfile
), creating aProcfile
, and then runningforeman start
on your command line. -
Public Activity We spent time looking at the Public Activity gem, it's benefits and drawbacks. If you're looking to create a user notification system in your application, you should check out this gem.
-
Release It! This is an awesome book written by Michael Nygard, a consultant who has worked on disaster recovery of extremely large systems (think Amazon-esque e-commerce sites or airport check-in terminals going totally offline). Michael discusses the various ways that large systems fail and how to prevent those failures.
-
Tool Set It's good practice to invest at least an hour or two per week into refining your tool set. Your tool set is everything you use to develop your applications. It includes your text editor, your bash prompt (terminal), any scripts that you use, and even the browser that you use to view your web application and search for answers. Optimize everything. If you're reaching for your mouse while in your text editor, that's an inefficiency. Look up the keyboard shortcuts and memorize them. Look up shortcuts, bundles, and plugins for your editor. Learn how to write basic bash scripts. Even better, figure out what you're doing repeatedly and learn how to automate it away using a Ruby script.
-
Turbolinks Put simply, Turbolinks uses Ajax to speed up page rendering speed in most applications. For a working understanding of Turbolinks in Rails, you should start by reading about Ajax in Rails. There are pitfalls to using Turbolinks if you are adding it to an application with tons of existing JavaScript or if you're trying to make it work with particular JS frameworks. Boris Staal does a decent job explaining the common issues programmers run into using Turbolinks.
Happy Hacking!
Joe