FIVE THINGS Programming

Mike Perharm.com

• 1. Five Common Rails Mistakes

May 5, 2012 • Mike Perham

I’ve worked with Rails for quite a while now and in that time I’ve seen a lot of Rails applications and both read and written a lot of bad Ruby code. Here’s five common mistakes that I see in almost every Rails codebase.

  1. Migrations with no schema specifics
  2. Object-Oriented Programming
  3. Concatenating HTML in helpers
  4. Giant queries loading everything into memory
  5. GitHub code review


• 2. Rails – trailblazer gem | RubyGems.org | your community gem host

A high-level, modular architecture for Rails with domain and form objects, view models, twin decorators and representers.

Here is the GitHub Project


"Trailblazer is a thin layer on top of Rails. It gently enforces encapsulation, an intuitive code structure and gives you an object-oriented architecture.

In a nutshell: Trailblazer makes you write logicless models that purely act as data objects, don’t contain callbacks, nested attributes, validations or domain logic. Controllers become lean HTTP endpoints. Your business logic (including validation) is decoupled from the actual Rails framework and modeled in operations."

Just listened to Ruby Rogue 206 with Nick Sutterer, the author of the gem package. These gems take away some of the “where do I put this piece of the puzzle in the Rails ecosphere.”

206 RR Trailblazer with Nick Sutterer – Ruby Rogues – DevChat.tv

Meanwhile, over on Javascript Jabber

Javascript Jabber

Javascript Jabber

• 3 158 JSJ Roots with Jeff Escalante – Javascript Jabber – DevChat.tv


"Roots is a fast, simple, and customizable static site compiler.

Why should you care?

If you make a lot of websites, or perhaps even make websites as a profession, there’s no doubt that you will want to be very efficient at making websites, and on top of that you’ll probably want to have the websites you make be very fast, cheap to host, and simple to build and optimize. If this is the case for you, my friend, you have come to the right place – roots is what you are looking for.

Roots is a tool for web developers to build static sites very quickly. Now, this doesn’t mean that it’s reserved only for websites without a server – roots is also set up to be able to work very smoothly with client-side mv* frameworks like backbone or angular, and compliments them very well.

Roots is completely transparent, and is behind many large websites in production. It is sponsored heavily by carrot creative, has been under active development for almost 2 years, and is very actively maintained and developed to this day. In short, you can rely on roots.

Roots is certainly not the only static site compiler out there. But in our opinion, it’s the most powerful and easiest to use. Give it a shot and see for yourself!"

This is not a fit if you are just trying to do a blog, though you can rig up a WordPress Plugin and use WordPress as a backend to your static site. What you gain is the raw speed and simplicity of a static site. It’s use of modern pre-compilers is admirable.

Plugins | Roots

Dynamic Drive

• 4. Dynamic Drive CSS Library- Mobile Full Screen Expand Menu

Author: Dynamic Drive

“Full screen menus are quite the rage these days, as they work out of the box across devices big and small with their large footprint. This mobile full screen menu expands itself to fill the whole page when activated, using the popular CSS checkbox adjacent sibling technique to toggle the menu between open and closed when the drawer style toggler is clicked on. The menu works across all modern browsers and mobile devices, while in IE8, a more limited interface is presented that’s at least functional for those users.”

This comes with CSS, HTML and a companion JavaScript function that lets you toggle the state of the full screen menu beyond the built in interface, from anywhere on the page as you see fit.

CSS Drive

• TOOLS – Colours Pallete Generator

“Welcome to CSS Drive’s Image to Colors Palette Generator! Upload an image to generate a color palette based on the image’s primary colors. Useful for quickly grabbing a particular color within an image for inspiration.
Choose an image to upload or enter image URL and then press ”GET PALETTE“:”