When you want the table headers to always stay around (e.g. because that table is huuuge), use the code below...
If you come across an (older) application that is using Prototype instead of jQuery, you may often see events bound...
Declare an enum attribute where the values map to integers in the database, but can be queried by name.
When you, as a developer, look at the choices used to build a particular application, you’re blown away at...
By default, Rails' validates_uniqueness_of does not consider "username" and "USERNAME" to be a collision. If you use MySQL...
Article about implementing authentication (current_user) and authorization (access rights) in AngularJS. Has an surprising amount of practical and understandable...
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...