When you just went through a long debug-fest and infested your code with dozens of debug messages, it can...

Occasionally some complex query must be processed on the database because building thousands of Ruby objects is impracticable.

Regular spaces and non-breaking spaces are hard to distinguish for a human. Instead of using the   HTML entity...

blog.jcoglan.com

Terminus is a Capybara driver where most of the driver functions are implemented in client-side JavaScript. It lets you...

github.com

Sometimes you inherit a non Rails or non Rack based web app such as PHP, Perl, Java / JEE, etc. I...

If you get an error message like that you are missing the Aspell files a specific language:

github.com

Hooks lets you define hooks declaratively in your ruby class. You can add callbacks to your hook, which will be...

timetobleed.com

This post will describe how I stumbled upon a code path in the Linux kernel which allows external programs to...

It can be useful to have a Ruby expression like condition ? positive_case : negative_case in MySQL queries:

makandra dev
ruby-doc.org

[ ] [ ]= ** ! ~ + - * / % + - >> << & ^ | <= < > >= <=> == === != =~ !~ && || .. ... ? : = %= { /= -= += |= &= >>= <<= *= &&= ||= **= defined? not or and if unless while until begin/end For more information see Table 18.4 in The Pragmatic Programmer's...

A good tool to generate strong passwords and secrets is "apg". You can get it with sudo apt-get install...

github.com

Ruby gem that provides an AR-style interface for the Pivotal Tracker API.

You need to install the following packages before you can build the Paperclip gem: sudo apt-get install imagemagick librmagick...

makandra dev

A popular ruby idiom I keep stumbling upon is def do_some_thing_for(values) values = Array(values)

Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']) or a hash (:conditions => { 'state' => 'draft...

There are many different methods that allow mapping an Array to a Hash in Ruby. Array#to_h with a...

makandra dev
robots.thoughtbot.com

Getting started with Ruby extensions in C.

makandra dev

If you want to rename a key of a Ruby hash, this could help you out. Just put it into...

github.com

delocalize provides localized date/time and number parsing functionality for Rails.

First of all: You could just use RVM which would make the pain go away. If for some reason you...

github.com

You can use the whatlanguage gem to detect the language of a Ruby string. Note that it also has not...

makandra dev

There are two distinct ways of commenting Haml markup: HTML and Ruby. HTML comments This will create an HTML comment...

makandra dev

This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...