timeless.judofyr.net

This must be one of the coolest, yet quite unknown, technique in Ruby. For certain types of problems (e.g. when...

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

When you need to see the content of a page (i.e. not all the HTML but the relevant text body...

makandra dev
railsforzombies.org

Learning Rails for the first time should be fun, and Rails for Zombies allows you to get your feet wet...

Styling button tags across all major browsers is not easy. Many times you should be fine by using the native...

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

gurge.com

How to write to the db 27,000 times in 24 seconds instead of 9 minutes.

You can use these step definitions: Then /^I should not see an error$/ do (200 .. 399).should include(page.status_code...

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

If you want to find out whether a Class object is directly inheriting from another class, use superclass: ActiveRecord::RecordNotFound.super...

snippets.dzone.com

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

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

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

tug.dk

Gallery of fonts you can use without much hassle in LaTeX. The license of the fonts vary, but are all...

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

This card explains how to install RubyMine for the first time. If you want to upgrade an existing RubyMine installation...

avdi.org

When rendering a partial with the :collection option, you are automatically provided with a counter variable inside the partial template...

nokogiri.org

Because Nokogiri needs to be compiled and dynamically linked against both libxml2 and libxslt, it has gained a reputation for...

Have you guys ever done the math on that? You asked or allowed for 24000 interruptions from literally every human...