Development environment setup Rails Composer Basically a comprehensive Rails Template. Prepares your development environment and lets you select web server...
rake stats # => LOC per controllers, models, helpers; code ratios, and more rake notes # => collects TODO, FIXME and...
Just found out about a great feature in Rails that seems to be around since Rails 2. Start a console...
Like in any language, a FLOAT will eventually corrupt data due to rounding errors. Please use DECIMAL, which has well...
Ask before leaving an unsaved CKEditor Vanilla JavaScript way, but removes any other onbeforeunload handlers: $(function(){ document.body.onbeforeunload = function() { for(editorName...
If you want to switch to another ruby versions, you have several options, depending on what you want: Do you...
Crazy hack. Might be useful one day. The code required has since been extracted into a library.
Colorizes code in LibreOffice Writer. Note that you need to create a paragraph style _code for this to work.
If your terminal has many tabs, you'll want to keep them organized. To change their title from the prompt...
I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...
A MySQL DECIMAL column is used when it is important to preserve exact precision. It takes two parameters, where...
We have released Modularity 2. It has many incompatible changes. See below for a script to migrate your applications automatically...
When you do something like this in your code: def var_value @var ||= some_expensive_calculation end
TLDR: This card explains which threads and processes interact with each other when you run a Selenium test with Capybara...
tl;dr: Using has_many associations with a :through option can lead to lost or duplicate records. You should avoid...
We've since created ActiveType which has a restricted subset of Virtus' features. It might be enough for your needs...
In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.
Modern IRB has time measurement built in. measure # Enable measure :off # Disable Custom Should your version of IRB not offer...
Before Rails 3.2.14, when supplying an invalid locale to I18n, it would fall back to its config.i18n.default_locale (which is...
If you're still working on ruby 1.8, you should know that using SimpleDelegator is often prohibitively slow. I have...
This error occurs when you already have a database.yml which defines the database for the cucumber environment instead of test...
When you want to find out the data type of an attribute, you can just use ActiveRecord's columns_hash...
I've written about the problem with user stories before. At the time, I found it better to just have...
If you get a Quota error with OpenStack, it doesn't have to be what it tell. For example, I...