When you use heredoc, string interpolation is enabled by default: x = "Universe" <<-MESSAGE Hello #{x} MESSAGE # => "Hello Universe"
Sometimes it seems a favicon does not work because your browser displays an old version or (in case of local...
TL;DR: You should generally use #size to count associated records. size Counts already loaded elements If the association is...
Here is a hacky way to load dumps directly from the source server, without fully copying them over and extracting...
When MySQL refuses to use your index, there's a number of things that you may be doing wrong. One...
Given you use Capistrano together with bundler to automatically install your gems when deploying. I recently had the problem that...
calc() lets you mix CSS units. Ever wanted to give an element "the container's width minus 20px on each...
tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...
JavaScript has no built-in functions to compare two objects or arrays for equality of their contained values.
Watch out when saying something like 1.year in Rails. The result is not a Fixnum and can cause unexpected errors...
So you want to know if you are on natty, precise, quantal, or something else? Check /etc/lsb-release. $ cat /etc/lsb-release
You might get the following error: Unable to initialize. Make sure the daemon is running. Error: Process /usr/lib/sflphone/sflphoned exited with...
Mozilla has announced that, starting with Firefox 22, the popular open source web browser will begin blocking third-party cookies...
In Ruby 1.9, instance_eval calls the block the with receiver as the first argument: In Ruby 1.8, receiver.instance_eval...
MongoMapper is a MongoDB adapter for Ruby. We've forked it so it works for Rails 2.3.x applications running...
Ruby 1.9 changed the default behavior of Module.const_defined? from what it was in Ruby 1.8 -- this can be especially...
If you open a pop-up window [1] in your Selenium tests and you want to close it, you can...
See attached link for a way to extract the conditions of a named scope in Rails 2.3.
This error can happen in Ruby 1.9. To fix it, add the following line to the top of your .js.erb...
Rails 2.3.16+ on Ruby 1.9 causes warnings like this: .../gems/activesupport-2.3.17/lib/active_support/core_ext/string/output_safety.rb:22: warning: regexp match /.../n against to UTF-8 string...
JavaScripts and CSS should be minified for production use. In Rails 3.1+ the asset pipeline will take care of this...
Prepare to explain customers what changed if your application renders PDF documents to users.
If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...
If others on a call (Skype, SIP, ...) can not hear you loud enough, your volume levels are probably too low...