MySQL to MongoDB conversion

For photostre.am I wrote an migration script to migrate the MySQL database to MongoMapper.

Maybe it’s good use for someone, this is the actual script at gist.github.com and no abstract something which you give up to extend after a while. The migration actually uses ActiveRecord::Migration, could well be about the last one that I’ll ever write.

Lessons learned:
  • Keep the old id from MySQL for a while, but rename it
  • Don’t do too many EmbeddedDocuments

scrum presentation

For this year’s BarCamp Salzburg I prepared a presentation on scrum, this agile process I fell in love with while I was in London. Lessons learned after I held the presentation? Examples first.

See the presentation (done with Dr. Nic’s codex): http://ananasblau.com/scrum

jaxdoc: Ruby on Rails docs on AJAX

Rails API with jaxdoc I became big fan of the jaxdoc generator for rdoc in the last months. It’s amazing to find out that you can extend rdoc to generate the docs (and I really love having docs on my local machine) the way you want it. Jaxdoc provides you with ajaxfied documentations which make searching in the docs much faster. Not to forget that you the source of the methods, just like normal rdoc. There are a few download packages at railsbrain.com and one for ruby core at rubybrain.com. But there’s no howto for creating your own docs, so I hope this example to generate for Rails 2.0.1 is complete enough for everyone. If not, please drop me a note. The exclusions could be defined a bit better I guess. And of course you can include other gems if you want a fat documenation.

1
2
3
4
sudo gem install jaxdoc
VERSION='2.2.2'
cd /opt/local/lib/ruby/gems/1.8/gems/
rdoc -S --op ~/docs/rails-$VERSION --fmt ajax --exclude .*generator.* --exclude .*test.* --include actionmailer-$VERSION activerecord-$VERSION actionpack-$VERSION activesupport-$VERSION activeresource-$VERSION rails-$VERSION

no more grep: rak

I’m a big big fan for grep and sure couldn’t program without it. Especially if you are working in an existing project or software and don’t have a complete picture yet or the software is a confusing patchwork, grep is sometimes my only tool besides the editor. grepping in an rails app can be necessary too, sometimes, and with rak there’s an alternative for the lazy among us. The only features over grep are highlighting the pattern and skipping the files/directories for version controlling.