Note to myself: Useful Regular Expressions

Find all opening and closing font tags with any given attribute to replace them with nothing:

regular expression search and replace screenshot

This looks for a “<” followed by zero or one “/” followed by the string “font” followed by zero or any character followed by a “>”. This means you shouldn’t have “<” or “>” in your attributes.

If you need to find all files that contain these font tags you can use the following command in the directory containing the suspected files:

grep "<font>" * | cut -d':' -f 1 | sort | uniq

Lovely.

Lost my Jabber Contact List

This is a weird one. For some reason I lost my entire Jabber contact list. So if you still want to have (at least) virtual contact with me all you have to do is to re-add me to your contact list and re-request authorization from me. In exchange you get authorization back from me and everything should work again. I have two Jabber accounts now, just to be safe. You can re-add me with my hukl@jabber.berlin.ccc.de address which will remain my primary Jabber account and for redundancy purpose you can also add my hukl@jabber.ccc.de account.

The question is: How many of my jabber contacts are reading my blog?

So on and snow fnord!

Magic Snowflake

Quote from the Principia Discordia, page 69.

The web2.0 equivalent of color

Have you heard of »kuler« yet? You have to say it like [kaler/kaoler] or like »color« because that is what kuler is about. To make things short, kuler is a flash application for creating color schemes. Its pretty neat but it is flash and you need to create an account to save your schemes. You can even create color schemes which you can import in your Adobe Creative Suite applications. Doesn’t sound to bad but I think its kind of worthless for print design. I’d rather go for CMYK, HKS or Pantone tables to create color schemes although it could work, at least to get a first idea. But why does it have to be Flash? This could have been such a nice Javascript web application. Remember colr.org? I blogged about their site a couple of months ago. Their site is for the exact same purpose, composing nice colors. The whole thing is done in Javascript and you can even generate colors from pictures you’ve uploaded.

This is actually a nice example for Flash getting more and more obsolete. Imagine using Javascript, XHTML and SVG with some sort of backend. I mean it should be possible to do many of the things Flash can do especially because Flash’s Actionscript is basically Javascript. Actionscript is simply wrapping some logic and the animation context in neat commands. If someone would come up with a Javascript library that would do the same, creating an animation context (FPS, animation loop, tweens, etc), it should be a lot less pain creating fun things without Flash.

I put a small demo together on smyck.org some weeks ago. The code is a little nasty but it was done in five minutes and it worked the way I wanted it. My goal is extending this demo further. I want to try out SVG. The only problem is the time that is missing right now.

While everyone is busy getting their web2.0 bubble business going there are still things to look at.

I don’t feel like creating an account at kuler.adobe.com

RubyOnRails on Mac OS X Tiger (10.4)

In the past it has been quite difficult to get RubyOnRails running on you Mac OS X but I just found out that all the pain has vanished. Especially the setup guides on the rubyonrails.org website are a little confusing because most of them are outdated. So if any of you are still interested how to set everything up, read on – I’ve written a small guide.

What you need

No matter what operating system you are using there is a minimum set of tools you need to have installed and ready to run:

Mac OS X

Simple Setup

The setup on Mac OS X is pretty simple. You can download Locomotive which is an all-in-one RubyOnRails package. It gives you an entire framework with everything included to run RubyOnRails on your machine. There are even different bundles available to extend the features of rails.

The database part is simple too, in theory. There is a package called MAMP which provides an Apache webserver and a MySQL server. This package also includes phpMyAdmin which enables you to manage the database with a GUI web front-end.

Another way would be to install MySQL by downloading the .dmg file from the MySQL website and to install it afterwards. The standard package is all you need. This package includes a system preferences panel that allows you to start and stop the mysql server with a button. Furthermore I would recommend YourSQL or phpMyAdmin to manage the databases.

Setup for Pro’s

The better way, instead of using these prepackaged solutions, would be installing everything by hand. Therefore you need to download and install the Apple Developer Tools (also known as Xcode). You need an Apple ID / Account to download Xcode. Then you need MacPorts (formerly known as darwinports). MacPorts is a collection of unix ports. These allow you to compile almost any unix tool that is not natively available for Mac OS X. To get the MacPorts on your mac go to the MacPorts download page and get the .dmg file (NOTE: I’m not sure if these .dmg files work on Intel Macs, let me know if you checked that). Unpack and install it. There is guide on the MacPorts website that gives you additional instructions for setting everything up. Afterwards read through the quick guide to learn the basic concepts of MacPorts. If you feel ready, continue with installing everything else.

First of all there is a RubyOnRails port. By installing this you get ruby, the rails framework and any other dependency you may need. You can install it by opening your Terminal.app. Then type in ‘sudo port install rb-rails’ and the magic should begin. Basically this command downloads all the necessary files, compiles and installs them in the right location.

After that its time for MySQL. Type ‘sudo port install mysql5’ to get the latest version of MySQL5 compiled for your very system. This should take a couple of minutes. Afterwards you can start the mysql daemon by invoking ‘sudo /opt/local/mysqld_safe5’ in your terminal.

If you choose to install MySQL with the .dmg mentioned in the simple setup you can start it with the preference pane or by typing ‘sudo /usr/local/mysql/mysqld_safe’.

Documentation