Enumerable#count can do three things. With no argument provided, it returns the number of items. With an argument, it...

Array#flatten by default flattens an array recursively. To only flatten the array for e.g. one level, it takes an...

I got the following error after updating the selenium-webdriver gem: wrong number of arguments (0 for 1) (ArgumentError) /home/pointoo-dev/.rvm/gems/ruby-1.8.7-p374/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/common/platform.rb...

guides.rubyonrails.org

When running migrations with rake db:migrate, there's the STEP and VERSION parameters that you can pass to nearly...

makandra dev

It's like a GUI for the famous git add [-p]. Select files with the up/down-keys and hit

The easiest way to detect touch-capable browsers is to check for the presence of touch events. It is no...

coffeescript.org

The Javascript in operator does what Hash#has_key? does in Ruby: Return whether an object has a property.

makandra dev

TL;DR Block formatting contexts establish an isolating container. float and clear only apply to elements within such a container...

The CSS property z-index is not as global as you might think. Actually, it is scoped to a so...

To find a hash key by it's value, i.e. reverse lookup, one can use Hash#key. It's available...

tldr; Use git diff -M or git diff --find-renames when you've moved a few files around. Usage

vikingcodeschool.com

In this post, I'll walk you through the four phases of the typical journey into coding and what you...

If you're getting this strange error message when setting debugging breakpoints, probably HAML is the culprit. Cause

makandra dev
github.com

Geordi 1.0 features a command line application geordi, that holds most of Geordi's previous commands. New features

Add gem 'database_cleaner' to your Gemfile. Then: Cucumber & Rails 3+ # features/support/database_cleaner.rb DatabaseCleaner.clean_with(:deletion) # clean once, now DatabaseCleaner.strategy = :transaction...

When a gem author releases a new version to Rubygems, usually a tag with the version number (e.g. v1.2.0) is...

If you paste multiple lines of text into a cell, Calc's AutoCorrect will change the first character of the...

github.com

Jonas Nicklas, the author of Carrierwave and Capybara, has released Refile, a gem for handling file uploads in Rails. It...

phpied.com

Some insight into how browser rendering engines work. The article shows how the way you manipulate styles (and the DOM...

ImageMagick takes a string with several options when cropping an image. See the command line options for how to provide...

mjt.me.uk

Addressing is a fertile ground for incorrect assumptions, because everyone's used to dealing with addresses and 99% of the...

In the tradition of our PostgreSQL cheat sheet for MySQL lamers, here is a cheat sheet for Jasmine when you...

Here is a Javascript function reloadUsers() that fetches a HTML snippet from the server using AJAX and replaces the current...

docs.puppetlabs.com

The condition for an if statement has to resolve to a boolean true/false value. However, all facts are strings, and...