Monthly Archives: July 2008

Mac OS X color showing ESC[whatever for git-diff colors (and more)

Since my upgrade to OS X 10.5 I have been having a terrible time getting colors to work with git. Originally I was using OS X 10.5.4, git version 1.5.3.1, and iTerm or Terminal.app. $TERM=xterm or xterm-color. I have color with PS1, ls, vim and most git tasks. However, git diff (or git show) always screws [...]
Posted in git, osx, shell | 12 Comments

ActiveRecord from_json and from_xml

Unless I’m missing something, the default rails from_json and from_xml methods don’t work with data that have associated objects. Here are routines that work for some simple examples I’ve tested. I placed this code in vendor/rails/activerecord/lib/active_record/base.rb within the ActiveRecord::Base class, but there might be a better place to put it. def self.from_hash( hash ) h [...]
Posted in programming, rails | Tagged , , , , , | 4 Comments