blog.codeclimate.com

Splitting a long method into sub methods is easier in instances since it is in classes. Since...

String#indent is not a standard Ruby method. When you use it, be sure to know where this method comes...

robots.thoughtbot.com

Arel is a library that was introduced in Rails 3 for use in constructing SQL queries. Every time you pass...

Ask before leaving an unsaved CKEditor Vanilla JavaScript way, but removes any other onbeforeunload handlers: $(function(){ document.body.onbeforeunload = function() { for(editorName...

makandra dev
tech.taskrabbit.com

At TaskRabbit, we have gone through a few iterations on how we make our app(s). In the beginning, there...

If you get this error while trying to resize an openstack instance: # nova resize fooinstance 16 --poll ==> /var/log/nova/nova-scheduler.log <==

In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.

If you get a Quota error with OpenStack, it doesn't have to be what it tell. For example, I...

robots.thoughtbot.com

One of many useful techniques when your test suite needs to talk to a remote API.

It is good programming practice to Don't Repeat Yourself (or DRY). In Ruby on Rails we keep our code...

If you need to test interaction with a remote API, check out the VCR gem as an alternative to Webmock...

makandra dev
compass-style.org

Since we are migrating from our homegrown mixins.sass and helpers.sass to Compass, here is a list of all the mixins...

This card shows how to upgrade a Rails 2 application from Rails 2.3.8 through every single patch level up to...

chartjs.org

Chart.js seems to be a good alternative to Google's Chart API and other commercial chart drawing libraries.

github.com

MongoMapper is a MongoDB adapter for Ruby. We've forked it so it works for Rails 2.3.x applications running...

perl.plover.com

So you have a method returning a regular expression but one case that should not yield a matching Regexp object...

If bundle install shows the following message for you ... Error Bundler::HTTPError during request to dependency API ... upgrade to Bundler...

In our continued quest to extract proven code snippets from makandropedia into tested and upgradable gems, we have released Edge...

TLDR: Ruby class variables (@@foo) are dangerous in many ways. You should avoid them at all cost. See bottom of...

developers.google.com

The attached article outlines considerations when choosing client-side vs. server-side implementations of the Google Geocoding APIs (geocoder, directions...

Calling bundle update GEMNAME will update a lot more gems than you think. E.g. when you do this...

makandra dev
github.com

Axlsx is an incredible gem to generate "Office Open XML" spreadsheet files (XLSX). Does not break on large spreadsheets and...

creativecouple.github.com

jquery-timing is a very useful jquery plugin that helps to remove lots of nested anonymous functions. It's API...

If - for whatever reason - you have to render stylesheets dynamically, the following snippet might be of help. It emulates what...