On 32bit systems, the maximum representable Time is 2038-01-19 03:14:07 in UTC or 2038-01-19...

makandra dev

This tool is used on our application servers (and called when deploying) but it also works locally. Just call dumple...

The code below shows a method #validate which uses Nokogiri to validate an XML document against an XSD schema. It...

Note that this sounds good but is not good at all when hooking tasks on cap deploy (see this article...

When you use the send_file method to send a local file to the browser, you can save resources on...

When you try to remove a non-existing index using remove_index, the migration will incorrectly pass without an error...

This might be due to AppArmor denying the MySQL server access to most of the filesystem. You can instead use...

There are times when you need to send SQL to the database, like this: def self.some_count(field) field = connection.quote...

When defining a trait using the Modularity gem, you must take extra steps to define constants to avoid caveats (like...

opensoul.org

I love ETags, but there’s something that annoys me: most implementations revolve around pulling a record out of a...

Are you adding a "Then show me the page" and re-run Cucumber whenever there is a failing scenario? Don...

Find-as-you-type boxes are usually built by observing changes in a text field, and querying the server via...

Update: This trick probably isn't very useful anymore in Ruby 2.x. The Ruby GC has improved a lot...

kernel.org

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

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

makandra dev

If you need to export data from MySQL to a CSV, you can profit from really fast built-in methods...

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

Using this step definition you can check if any form field (text field, checkbox, etc) or button is disabled:

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

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

makandra dev

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