Software creative always looking for a challenge

Author: Michael Yagudaev

Switch: Add Multiple Languages to Your Site Using Google Spreadsheets

Dealing with multiple languages (aka locales) can be challenging. Having multiple JSON files with hundreds of keys for each language quickly becomes a maintenance nightmare. It is easy to break, adding/removing a key means you have to edit it across all files and make sure you get the right translations.

Wouldn’t it be great if we can just provide our translators with a link to a spreadsheet and they could just edit everything on their own and leave us to do the things we love?

Switch is a command-line tool to help get a different view of the same data. It allows you to switch between JSON and CSV with a simple command. You can even automate the process so that it does so automatically on the server without your involvement.

Checkout the gem at:
Checkout the demo project at:

Ruby Debugging Tip: Vendor-in Your Gems

Coming to Ruby from Node.js, I was used to always having all my code at the tips of my fingers, right inside my sweet project. When I first came to Ruby, I was glad to have that distraction removed at first. Then about a year and a half or so later I was introduced by my co-worker Adam Maddox to vendoring gems in ruby.

This simple line installs all the gems into the vendor directory instead of the system gem directory. It creates a small file under .bundle/config to let bundler know to go through this new directory to find gems going forward.

Next just add it to the gitignore since we don’t want this in our source control.

 Why Would You Ever Want This?

For starters it makes it much easier to debug your code by allowing you to put debug code right into the source code of your gems. Imagine you got a weird validation error and your application code is no where to be found in the stack trace. What do you do? Well if you have things vendored in, you can simply add binding.pry right on that specific line.

Another advantage is that you won’t have to worry about different gems conflicting between ruby versions. Of course it is not a problem since we all know you are already using rbenv ;).

The real gem here is that you will be able to now find where all the magical methods you have been using reside. A simple search in your trusty code editor will reveal the truth!


What happens if you don’t want your searches to yield a ton of results coming from the vendor directory? Well Simply ignore that directory. If you are using sublime it is as simple as adding this to the where clause of your search.

That is it, happy coding :).

Also checkout heroku’s blog for cool debugging tips.

Stubbing without RSpec

In rspec you can typically call the stub method to stub something out. However, this method only works inside an example or  a before(:each) block. Try using rspec stubs anywhere else and you get the following error message

The use of doubles or partial doubles from rspec-mocks outside of the per-test lifecycle is not supported.

What if you wanted to temporarily stub out one object inside a before(:all) (since you like those fast test, don’t you 😉 or globally for the entire test suite for say disabling image processing. How would you do that?

Simple, Ruby has this magic word called metaprogramming to rescue us.

Instead of doing:

Just do:

That is it. We just overwrote the definition of the process method for only this one image instance. No side-effect or stub-code leakage will occur here.

0idle: A marketplace where Event Organizers find Venues

My roommate (Anton Kishchenko) and I started working on a marketplace to help event organizers find venues called 0idle. After initial market research, we received great feedback and decided to start building the product. I decided to start building it in Rails, since I have worked with it before, knowing that it is a great framework.

Introduction to Backbone Part 2 – Server-side

I finally found the time to complete the second part of my introduction to backbone.

You can find the complete source code here:

I have been really busy with 0idle among other things like moving to Vancouver. But thanks to a 30 day procrastination therapy challenge (watch video and join) I finally finished it :).


Introduction to Backbone Part 1 – Client-side

I decided to do a screencast showing off how to use backbone.js. There are two parts to the screencast, the second of which will be posted next week.

The first part covers the client-side aspect of backbone.js which consists of Models, Collections and Views.

You can find the complete source code here: