If you’re testing the behavior of deprecated code in your Ruby project, the warning messages littered throughout your spec...
When your site is mapped into the URL-space of another server using mod_proxy, ProxyPass and ProxyPassReverse, all requests...
If you need to find out which of your local commits are not on the remote server do this:
I was recently confronted with the task of creating a two-column liquid layout with a header and footer in...
You configured authentication in your Apache configuration that requires username and password but you want a single IP address, host...
So you added a new callback to your model that (e.g.) caches some data when it is saved. Now you...
Use the htmlentities gem. Encoding works like this: require 'htmlentities' coder = HTMLEntities.new string = "<élan>" coder.encode(string) # => "<élan>"
Deadlocks only occur if two transactions in separate threads compete for the same rows in the database. They usually (but...
You can get YAML.load to instantiate any Ruby object by embedding the desired class name into the YAML code. E.g...
If your controller spec never reaches your controller code: Make sure you are signed in. Make sure you are actually...
The first thing you need to understand is that the purpose of refinements in Ruby 2.0 is to make monkey...
When you just went through a long debug-fest and infested your code with dozens of debug messages, it can...
Plugins (and gems) are typically tested using a complete sample rails application that lives in the spec folder of the...
This collection of Sass mixins enables cross-browser styling (including IE with CSS3PIE) with less lines of code.
This is non-trivial because you need to fake event objects and require different code for different browsers. Luckily, there...
For clarity and traceability, your commit messages should include the ID and title of the Pivotal Tracker story you're...
Regular spaces and non-breaking spaces are hard to distinguish for a human. Instead of using the HTML entity...
Given this class: class Foo class Bar end end If you want to clean up this code with the modularity...
If a controller action responds to other formats than HTML (XML, PDF, Excel, JSON, ...), you can reach that code in...
The ancestry gem allows you to easily use tree structures in your Rails application. There is one somewhat unobvious pitfall...
Note: We are talking about Machinist 1 here, Machinist 2 may have solved this or might require a different approach...
If you want to see how long your database queries actually take, you need to disable MySQL's query cache...
This post will describe how I stumbled upon a code path in the Linux kernel which allows external programs to...
[ ] [ ]= ** ! ~ + - * / % + - >> << & ^ | <= < > >= <=> == === != =~ !~ && || .. ... ? : = %= { /= -= += |= &= >>= <<= *= &&= ||= **= defined? not or and if unless while until begin/end For more information see Table 18.4 in The Pragmatic Programmer's...