When you don't only have a favicon.ico in your project but also PNGs of different sizes and backgrounds, you...
Code snippet tested with Rails 2.3 def index # ... if request.xhr? html = render_to_string(:partial => "list", :layout => false) respond_to...
The adjust-hue function of Sass allows you to change a color's hue, but only relative to its current...
If your requests blow up in Ruby or CURL, the server you're connecting to might only support requests with...
In whenever you can schedule Ruby code directly like so: every 1.day, :at => '4:30 am' do runner "MyModel.task_to...
When you cannot make Selenium trigger events you rely on (e.g. a "change" event when filling in a form field...
As you know, assignable_values does not invalidate a record even when an attribute value becomes unassignable. See this example...
RSpec 3.0 deprecates the :should way of writing specs for expecting things to happen. However, if you have tests you...
When you have a string containing umlauts which don't behave as expected (are not matched with a regexp, can...
So you want your Ruby script to install missing gems instead of dying? Take this method: def installing_missing_gems...
If you get this error when you try to resize an OpenStack instance: # nova resize example 23 --poll
React.js is a relatively new Javascript templating engine that has two-way-bindings like AngularJS or Batman. The interesting idea...
Spring is a Rails application preloader. When debugging e.g. the rails gem, you'll be wondering why your raise, puts...
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...