Eloquent Ruby

At the moment I am sick at home and use the time to finally read some books that where on my to-do list. The first was “Eloquent Ruby” by Russ Olsen.

It got very positive reviews around the net, including Peter Cooper, who said:

Eloquent Ruby [...] is the first Ruby book I’ve read in its entirety within 24 hours; it’s that good.

There is also a positive review by Antonio Cangiano.

What’s it all about? Basically Eloquent Ruby doesn’t try to teach you to write Ruby code, it tries to teach you how to write good Ruby code. Not only by telling you how to write it, but also by explaining why the Ruby world choosed that certain way to do it. I have read it in one day and didn’t learn much while doing so. But it was a good reminder on how and why we Ruby Developers do the stuff we do. And it was a nice read nevertheless. Russ is a talented and very funny author. I would definitively read a book written by him even if it’s about fly-fishing :) . Even better: he reacts on tweets about his book.

Strong buying advice for everybody who just started to learn ruby or wants to feel more safe while coding in it.

Posted in Books, Development | Leave a comment

Yeah. The new projector.

Thanks to everyone who donated money for the video projector.

Here it is, in it’s full glory :) :

CoWoCo Cologne Projector
CoWoCo Cologne Projector

And now let’s start using the new baby. The first group that will be able to use it is the cologne.js on Tuesday.

Have fun with it!

Posted in Development | Leave a comment

A video projector for CoWoCo

If you look at hacking-cologne you will see that a lot of user group meetups are in a location called CoWoCo. It’s a really nice place with a lot of friendly people and enough Club Mate and Afri Cola for everyone. But one important thing is missing. A video projector.

This has to be fixed! If you want to help us, please consider donating here:

Click here to lend your support to: Beamer fürs CoWoCo and make a donation at www.pledgie.com !

Thanks!

Update: Thanks to everyone who helped getting the money for the video projector!

Posted in Events | 1 Comment

I *hate* the amazon start page

Sorry, but I really do. Every time I am searching for stuff on amazon it will have an effect on the start page. Articles that are similar to the search will show up. Regardless on how embarrassing they might be. I regularly search for gifts and I really don’t want those guys on my landing page.

Thinking of buying a present for your girlfriend? Never open amazon when she is around you. Even if you bought the present a few days ago. Amazon will ruin the surprise and show related products on your start page. Even worse: if a friend sends a link to an amazon product as a joke, it will show up there, too.

I won’t open amazon when other people look over my shoulder. Never. Because of that.

Posted in Websites | Tagged | Leave a comment

Promote JS

JavaScript JS Documentation: JS Function arguments, JavaScript Function arguments, JS Function .arguments, JavaScript Function .arguments The search for javascript on google leads to very bad sites, “promote js” tries to change this by promoting people to link to the mozilla documentation.

You should add this, too!

Posted in Development | Tagged | Leave a comment

Check MySQL Master-Slave replication

A lot of guides explain that you can use MySQL master-slave replication to scale your database performance. But nobody explains how to keep the database instances in synch. MySQL replications are very shaky and tend to break and mess up stuff very easily. From my standpoint the whole replication scheme looks like a smart hack into the MySQL system.

Till today I used some self written scripts to check our systems. Nobody told me that there was a perfect toolchain for this problem already existing: Maatkit. Maatkit offers a few commandline tools that help you to keep the slaves in synch with your master.

Install it using brew:

1
brew install maatkit

Check tables for differences :

1
mk-table-checksum h=HOSTMASTER,u=USERMASTER,p=PASSWORDMASTER h=HOSTSLAVE,u=USERSLAVE,p=PASSWORDSLAVE -d DATABASE | mk-checksum-filter

And after you found differences you can even use Maatkit to repair those tables:

1
mk-table-sync --execute --sync-to-master h=SLAVEIP,u=USER,p=PASSWORD,D=DATABASE,t=TABLE

Besides repairing damaged tables Maatkit helps you to check if the slave replication is still working. Mk-heartbeat updates a heartbeat table in the master database and checks if the slave database has been updated. I have written a small script that wraps the heartbeat check and sends a mail if the slave replication has stopped.

More documentation can be found here and a few examples in this presentation.

And yes, using couchdb would make this toolchain obsolete :) .

Posted in Development | Tagged , | Leave a comment

Events for developers around Cologne

I was tired to search for events in Cologne that could interest me. Others might have the same problem, so I created a shared calendar:

If you know events in the Cologne area (including Düsseldorf and Bonn), feel free to leave me a Note.

Update: You can now find the calendar on this site.

Posted in Events | Tagged , | 3 Comments

Vim and I

A little over a week ago I posted this on twitter:

First day of switching from textmate to vim. Let’s see if I still use macvim next week :) . Updated my dotfiles: http://bit.ly/bFuAoi

Today I am still using Vim. Am I a better developer now? Hell no. Choosing the best editor for your work is important. A craftsman has his hammer, we developers have our editor. You can hammer a nail in a wall with an average hammer. Nothing wrong with that. Maybe not as fast or as good as with the perfect hammer, but good enough. Am I a happier coder? Not quite yet. Will I stay with Vim? Yes, I think so.

For the last few years I used Vim only for editing stuff on my servers. It was okay, but I never thought of using it as my main editor for my desktop. A few months ago ruby developers in my twitter timeline startet to migrate to Vim. Some because Textmate2 looks like the new Duke Nukem, some because they just wanted to try out another editor. A lot of them where happy about the switch and started to advertise it very aggressively. Last week I had enough. I wanted to find out why all of a sudden everyone is happy with Vim.

The first thing I did was to look at my current vim configuration I had and to compare it with the configurations others where using. After two days(!!) of rewriting it and adding of a few plugins, I was able to start going. And since then I only used Textmate for a few minor things.

What I hate about Vim:

  • Bad defaults, you have to rewrite tons of stuff
  • You have to add a lot of 3rd party plugins to get it usable
  • Copy and paste is hard. Even when using MacVim with it’s mac keyboard shortcuts its harder than what you are used to (But you can activate Shift-Selection)
  • After I configured everything in MY way, nobody else is able to use my Vim and code on my desktop unless we all agree on a certain configuration

What I love about Vim:

  • You can extend nearly everything and rewire nearly everything
  • A lot can be done without the mouse. Opening files, switching directories, copying and moving files between directories
  • You use the same editor on the remote server
  • It is very fast

If you want to start using MacVim, you should definitely look at my dotfiles or at least look at my vim delicious bookmarks.

But is it the ideal editor? No. Not for me. But it’s close enough. What would my ideal editor look like? Something like this:

  • Command line mode to open/edit files without touching the mouse
  • Everything extensible : syntax highlighting, code completion, directory browser, command line commands, shortcuts
  • Fast and easy script language for the extension system. V8 comes to my mind here :)
  • Good default shortcuts for copy and paste and other standard operations. E.g. copy and paste should behave like in every other app
  • Good default for all other stuff. I don’t want to configure my editor for two days to get it usable.
  • Easy way to record and replay macros
  • FAST ui. Redcar feels really slow compared to Textmate and MacVim. Using the JVM is a really bad decision in my opinion.
  • A real desktop app that has an own menu and stuff. Terminal windows are okay for servers, but my editor should have its own Icon and its own menubar on my desktop.

So what would it take to get my ideal editor? Sadly I am not good enough in writing Cocoa Apps, but if you are, please write a thin Cocoa editor layer and put a good V8 extension system around it. After that I would love to help you code the extensions needed!

Posted in Development | Tagged , , | 15 Comments

Rockstar – a last.fm api v2.0 gem

A few weeks ago I added the possibilty to scrobble your viewed music videos to putpat.

Sadly I couldn’t find a gem that could do that. John Nunemakers scrobbler gem is very outdated and does not use the new authentification api. After searching through all available forks I made the decision to create my own fork of the old scrobbler gem. That fork is called rockstar.

I tried to made it compatible with the old scrobbler gem and added a few new features. For example now it’s possible to get a list of events for a certain location:

1
2
3
4
5
6
geo = Rockstar::Geo.new

# Get events for a location
geo.events(:location => 'london').each{|e|
    p "#{e.title} at #{e.venue.name}"
}

If you are missing a certain api call just write me, I will add that asap.

Posted in Development | Tagged | Leave a comment

Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax…

If you see this error:

1
Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types

You should update the Adobe Unit Types to a newer version that includes 64bit binaries. The latest version can be found here:

http://kb2.adobe.com/cps/516/cpsid_51615.html

Posted in Software | Tagged | Leave a comment