Better pixel to EMs CSS conversion with a Sass mixin

While working on a project (to be announced) creating responsive design templates from PSDs, I wanted to structure the positions and sizings in a way that allowed the greatest flexibility and sanity. Enter EMs. A great technique but requires conversion of pixels to EMs based on the current font size leaving you with cryptic “0.875em” and “1.125em” expressions throughout your CSS. Not the most maintainable code. A Sass mixin allows expressing measurements in pixels in code while using EMs in the final output.

UPDATE: I’ve published the code I use in a bunch of projects as a gist: PX to EMs conversion

Rails integration tests, RSpec, Capybara, and MySQL deadlocks

In the midst of writing integration tests with Capybara and RSpec, my tests started freezing and eventually giving me the error ActiveRecord::StatementInvalid (Mysql::Error: Lock wait timeout exceeded; try restarting transaction. Turns out this is a problem with RSpecs database cleaning strategy and manually seeding the database during a test run.

Node.js PaaS hosting services

"Node.JS Heroku nodejitsu nodesocket dotcloud nodester cloudnode joyent no.de"

PaaS (Platform as a Service) with support for specific stacks is the latest wave of cloud-based hosting services. Awesome providers such as Heroku show you why; simple (and often free) deployment and scaling of common stacks like Rails. Here are the best known Node.js PaaS offerings.