kernel.org

Git allows you to do a binary search across commits to hunt down the commit that introduced a bug.

When your site is mapped into the URL-space of another server using mod_proxy, ProxyPass and ProxyPassReverse, all requests...

linux.die.net

If you need to find out which of your local commits are not on the remote server do this:

alistapart.com

I was recently confronted with the task of creating a two-column liquid layout with a header and footer in...

In order to redirect all requests from redirecting-host.com to desired-host.com while keeping path and query params unchanged, change your Apache...

You configured authentication in your Apache configuration that requires username and password but you want a single IP address, host...

makandra dev

To clear the query cache in your MySQL database manually, e.g. for database profiling, execute the following command in your...

So you added a new callback to your model that (e.g.) caches some data when it is saved. Now you...

When you eagerly load an association list using the .include option, and at the same time have a .where on...

opensoul.org

Sometimes, you just need to shoot from the hip…or deploy your local changes without committing them. Put this snippet...

Use the htmlentities gem. Encoding works like this: require 'htmlentities' coder = HTMLEntities.new string = "<élan>" coder.encode(string) # => "&lt;élan&gt;"

snippets.dzone.com

These two models can be used to access the posts and associated comments of a WordPress database.

makandra dev

If you modified git's history and the change was already pushed, you will usually get a ! [rejected] my-branch...

To change the commit message of the latest (unpushed, unmerged) commit, you can use git commit --amend

Deadlocks only occur if two transactions in separate threads compete for the same rows in the database. They usually (but...

makandra dev

Lets say you need to make a change to a commit OLD_COMMIT, but this is not the most recent...

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...

apidock.com

To temporarily change the current working directory in Ruby, call Dir.chdir with a block. The previous working directory will be...

yehudakatz.com

The first thing you need to understand is that the purpose of refinements in Ruby 2.0 is to make monkey...

If you need to do calculations inside the database and can not use Ruby objects you may run into problems...

When a has_many association basically serves to store a list of associated strings (tags, categories, ...), it can be convenient...

When you just went through a long debug-fest and infested your code with dozens of debug messages, it can...

Note that this card is very old. You might want to use ActiveType for your auto-coerced virtual attributes instead...