ruby on rails – bundle reinstall

After an OS upgrade I needed to reinstall all the gems for my Rails project (well, I probably didn’t need to do it, but it seemed the quickest way).

Since I used RVM and only had one Ruby on Rails project I was working on, doing so is easy, though not intuitive.

To uninstall all the gems:

$ rvm gemset empty

Then install them the regular way:

$ bundle install 

You might get an error that looks like this: “There was an error in your Gemfile, and Bundler cannot continue.”.  If that’s the case, run:

$ gem install bundler

iOS: Make divs not have a shadow on touch

Similar to a previous Android issue, except this time for iOS.  It’s not really a problem per-se, but it can make your UI look less clean.  What happens by default in mobile webkit is that when you hold your finger on an element, a grey transparent box is overlayed on it.  To remove this, use the following CSS property:


What really matters is the last value in the 4 values, which sets the opacity to 0, in other words, makes it transparent.

OS X Brew – “Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master”

In the middle of a `brew update`, I killed the process with ctrl+c.  This left the git repo in a broken state.

Please move or remove them before you can merge.
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

To fix:

$ cd /usr/local
$ git add .
$ git stash
$ git reset --hard

`brew update` should now work.

Debug Node.js apps with node-inspector

If you’re writing code for Node.js, node-inspector is a must-have, and is far superior to Node.js’s built in debugger.  What you get by using it is a Javascript debugging tool nearly identical to Chrome’s Javascript debugger, but for your Node app.

To install it, just use npm:

$ npm install -g node-inspector

Since you’ll be connecting to node-inspector via your browser, you’ll need to spool up the node-inspector server as so:

$ node-inspector &

Finally, run your app in –debug mode:

$ node --debug app.js

Connect to and you’re good to go!

This setup description and more info can be found in the README.