When writing Rails migrations to convert a string column to an integer you'd usually say: change_column :table_name...

Working with lists in Javascript is painful because the native Array class is so poorly designed. One way to reduce...

makandra dev

For all late night coders: The program "redshift" changes your monitors' white balance according to your position on the planet...

In contrast to RSpec's included allow_value matcher, the attached matcher will also work on associations, which makes it...

bundler.io

bundle open BUNDLED_GEM will open the BUNDLED_GEM's source code in your default editor.

In order to keep the controllers directory tidy, we recently started to namespace controllers. With the :controller option you can...

When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module...

Custom matchers are a useful RSpec feature which you can use to DRY up repetitive expectations in your specs. Unfortunately...

Shared example groups are a useful RSpec feature. Unfortunately the default directory structure generated by rspec-rails has no obvious...

We tend to use database transactions as a magic bullet to get rid of all our concurrency problems. When things...

jimneath.org

The linked page lists and explains global Ruby "dollar" variables, such as: $: (load path) $* (ARGV) $? (Last exit status) $$ (PID)

1. Saving files to a directory that is not shared between deploys or servers If you save your uploads to...

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

Merge requests are often rejected for similar reasons. To avoid this, before you send a merge request, please confirm that...

Our development process makes us deploy very often. As the number of releases grows, junk clogs up the hard drive...

If you want a widget for awesome that runs a command regularly (every X seconds) and puts the output into...

When you need to find out in which kind of spec you are during run-time, it's definitely possible...

Sometimes you need a piece of code to do something different for specs than for features. If you don't...

Sometimes you want git to ignore certain files that appear on your machine. You can do this in 3 ways...

railway.at

Note: These instructions are for a quick per-project setup and may require you to change code. If you generally...

When HTTP clients make an request they can define which response formats they can process. They do it by adding...

Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...

We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...

tl;dr: Ruby's Bundler environment is passed on to system calls, which may not be what you may want...