Sometimes, you may want to open up a second database connection, to a read slave or another database. When doing...
For my Gem Session project Holly I ran the Ironman of drag'n'drop implementations: Dragging in nested lists
Makandra cards will auto-detect the language used for syntax highlighting. This auto-detection sometimes fails for short code snippets...
When you use method_missing to have an object return something on a method call, always make sure you also...
Applications often show or hide elements based on viewport dimensions, or may have components that behave differently (like mobile vs...
Updated the card with our current best practice (shared app code and specs via symlinks).
Sometimes you need to remove high Unicode characters from a string, so all characters have a code point between 0...
The Rails community has been abuzz with object-oriented programming, SOLID principles, laws, design patterns, and other principles, practices, and...
This sounds promising: The best part from the Rails side, is that you don’t have to change anything at...
If you're suffering from a huge de.yml or similiar file, cry no more. Rails lets you freely organize your...
In large forms (30+ controls) new Capybara version become [extremely slow] when filling out fields. It takes several seconds per...
The following code activates autoloading using ActiveSupport 3.x: require 'active_support' require 'active_support/dependencies' relative_load_paths = %w[app/controllers...
Localizing a non-trivial application can be a huge undertaking. This card will give you an overview over the many...
%p #{link_to "label", "url"}! Haml is a great engine for writing shorter, readable HTML. However, there is...
When requests arrive at the application servers simultaneously, weird things can happen. Sometimes, this can also happen if a user...
Removing duplication from the code is a seemingly easy task. In many cases it is pretty straight-forward – you look...
OCRA (One-Click Ruby Application) builds Windows executables from Ruby source code. The executable is a self-extracting, self-running...
Sometimes you need a special version of chrome because it has some features you need for testing, like in this...
You can use this code: function scrollToLine($textarea, lineNumber) { var lineHeight = parseInt($textarea.css('line-height')); $textarea.scrollTop(lineNumber * lineHeight); }
Controller responses often include Javascript code that contains values from Ruby variables. E.g. you want to call a Javascript function...
By default, Google Analytics tracks the current URL for every request. Sometimes you will want to track another URL instead...
CodeMirror is a JavaScript component that provides a code editor in the browser. When a mode is available for the...
When talking to your MySQL server via a mysql shell, you can terminate queries by ; or \G -- the latter gives...
This is a demo of the "Tabby" Javascript jQuery plugin to use tabs in regular textareas to make them suitable...