Archive for October, 2009

how to turn a happy programmer into something else

Don’t laugh, this could happen to you:

http://hashedbits.com/the-birth-of-the-grumpy-asshole-programmer/

Stage 1: The happy creative programmer
Stage 2: The proud father
Stage 3: The product guru
Stage 4: The grumpy asshole programmer

Comments

Pile of books – 4 years later

4 years ago I had this pile of books waiting to be read: http://morgane.com/2005/11/

The current list looks like this:

books

Some things never change…

Comments (6)

here-documents

Some ways of using here-docs:

name = "bob"
# interpolation
doc = <<DOC
  Yo #{name},
  what's up
DOC
p doc
#=> "  Yo bob,\n  what'
s up\n"
# indent the end marker
doc = <<-DOC
  Yo #{name},
  what's up
  DOC
p doc
# => "  Yo bob,\n  what'
s up\n"
# no interpolation
doc = <<-'DOC'
  Yo #{name},
  what's up      
  DOC
p doc
# => "  Yo \#{name},\n  what'
s up\n"
# replacing spaces with underscores
doc = <<DOC.gsub(' ', '_')
  Yo #{name},
  what's up      
DOC
p doc
# => "__Yo_bob,\n__what'
s_up\n"

Comments

cyberduck and snowleopard don’t like each other

Cyberduck won’t start on Snow Leopard. Install the new beta to fix it:

http://cyberduck.ch/

Comments

some awesome textmate shortcuts

as<tab>
  assert(test, "Failure message.")
ase<tab>
  assert_equal(expected, actual)
tc<tab>
 require "test/unit"

require "library_file_name"

class TestLibraryFileName < Test::Unit::TestCase
  def test_case_name
   
  end
end
:<tab>
  :key => "value",

Comments

uninitialized constant MysqlCompat::MysqlRes

It seems that I still don’t have a stable system, since I’ve upgraded to Snow Leopard a few weeks back.

Running db:migrate or entering cmd-R from TextMate fails with the following error:

uninitialized constant MysqlCompat::MysqlRes

I did a few different things, but I it boils down to having to do this:

$ sudo gem uninstall mysql
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/lib/mysql_config

(your mysql_config could be in /usr/local/mysql/bin instead, in which case make sure to use that path)

I’ve also wound up uninstalling mysql and reinstalling, though I don’t think those steps were necessary. Just in case, you might want to try that also. Go here: http://dev.mysql.com/downloads/mysql/5.1.html#macosx and get “Mac OS X 10.5 (x86_64)” from the package format section.

Comments (1)