Using the Timecop gem, you can easily test your password timeouts for your users. I use the following snippet in […]

for any given array arr, where you want to count the occurrences of each unique object in the array, arr.inject(Hash.new(0)) […]

Using Foreman, Sphinx, and Thinking Sphinx in a Rails project? Here’s how you can run Sphinx from your Procfile: web: […]

Delete RVM source lines from .bashrc (.zshrc/.bash_profile/.profile) Remove RVM installation: rvm implode –force Remove .rvmrc exec $SHELL -l brew update […]

build_stubbed will never hit the database, whereas build does for associations… much faster! http://robots.thoughtbot.com/post/22670085288/use-factory-girls-build-stubbed-for-a-faster-test

The assignments of values ​​separated by commas leads to interesting results: a = 1, b = 2, c = 3 […]

If you don’t know what is RVM, check it out. Setting your project environment with rvmrc rvmrc is a file […]

Hey, First post around here (among many other I hope). Okay, right to the point, at my work we often […]

str = ‘str’ {str => 1}.key(1).eql? str #=> true {str => 1}.key(1).equal? str #=> false str = ‘str’.freeze {str => […]

Recently I have had the pleasure of upgrading from end-of-life FreeBSD 7.0 to the latest 9.1. Along with it, I […]

After I saw the Alyssa post about Inconsistent Color Palettes and her Ruby script, I decided to try it. It […]