Ruby 2.0’s Version of Python’s PDB

2013.06.19 | Rails, Ruby | , ,

So ruby-debug is still broken for 2.0, but someone came up with a package called byebug.  Check it out.

Django: current transaction is aborted, commands ignored until end of transaction block

2013.01.16 | Python |

The error:

current transaction is aborted, commands ignored until end of transaction block

Can occur if you’re using PostgreSQL and forget to run your south migration.

Library not loade: /usr/local/lib/libfreetype.6.dylib (LoadError)

2012.10.19 | Rails, Ruby |
Reason: Incompatible library version: libMagickCore.5.dylib requires version 16.0.0 or later, but libfreetype.6.dylib provides version 15.0.0 


$ brew uninstall freetype¬ 
$ brew install freetype
$ brew link -f freetype

ruby on rails – bundle reinstall

2012.10.18 | Rails, Ruby | , ,

RailsConf Europe keynoteAfter 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

__rvm_cleanse_variables: function definition file not found

2012.09.24 | Shell | , , , ,

I started getting this error in OS X after I switched my Terminal shell from bash to zsh (with oh-my-zsh).

~/.rvm/scripts/initialize:50: __rvm_cleanse_variables: function definition file not found

To fix, run:

$ rm -f ~/.zcompdump

iOS: Make divs not have a shadow on touch

2012.08.09 | HTML5, iOS, Web Development | ,

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”

2012.07.24 | OS X | ,

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.

IE7 overflow: hidden is broken

2012.04.06 | Web Development | , , ,

If you’re having problems with overflow:hidden in IE7 or IE6, make sure you apply position:relative to the element, or overflow:hidden is ignored.

Client Side Javascript Error Logging

2012.04.04 | Javascript, Web Development | , , ,

Karl Seguin just published a great short article on the why and how to log client side Javascript errors.  Read it here with some HN discussion here.

Update: Consider using Google Analytics to log Javascript errors.

Debug Node.js apps with node-inspector

2012.03.31 | Javascript | , , , ,

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.