Ninetynine is a creative design & coding agency

Archive for March, 2009

Growl messages with AIR

with one comment

For an AIR application that I’m creating (more about that later), I needed some way to show the users some event happened while the application was running in the background. So what’s better on Mac OS than showing growl notifications ;) ?

Growl message with as3

Adobe has worked together with the Growl team to add support for AIR and flash applications.
Mike Chambers has put together an open source project named as3growl which provides an API to work with the new Growl build.

Read the rest of this entry »

Written by michiel

March 31st, 2009 at 4:21 pm

Posted in AIR,AS3,Flex,Mac OSX

Tagged with , , , ,

Thickbox: reinitialize Thickbox after change by Ajax

with 10 comments

Hi,

Thickbox is a very nice javascript library based on jQuery (which is also a very neat library). It is used to show images and documents in a sort of popup like Lightbox does.

Let me sketch the problem:

1) I load my page (also loading thickbox.js)
2) I change my content in one dom-element, for example a div element, through Ajax.
3) Then I want to call thickbox on an element in the new div.

You will that see nothing happens, because Thickbox hasn’t been able to register this object.

So basically we need to reinitialize Thickbox.
Read the rest of this entry »

Written by ruben

March 31st, 2009 at 4:08 pm

Posted in Ajax,Javascript

Tagged with ,

Ubuntu: backup to USB drive on mount

with 9 comments

Hi everyone,

I always was sloppy with my backups and I really needed to do something about it. I bought a new Freecom HDD 500GB and what I wanted to do is quickly backup my files every time I plug the device in, and it should give me a proper notice when the backup is done.

Doesn’t sound that hard, or does it?

It became clear that I needed a little thingy called “udev”. And with big help from unutbu from ubuntuforums.org I managed to get a very nice script up and running.

First thing you have to do is to know how your system recognizes your USB drive.

I followed this great tutorial here. (Don’t bother the fstab!)

My rules look like these.

1
2
 
SUBSYSTEMS=="usb", KERNEL=="sd?1", ATTRS{product}=="Freecom Network Drive", NAME="freecomHD", RUN+="/usr/bin/usb_backup.sh"

Note that I have saved them under “/etc/udev/rules.d/81-local.rules”, because /etc/udev/rules.d/README says. It would also be safer I you select your device using UUID.

Files should be named xx-descriptive-name.rules, the xx should be
chosen first according to the following sequence points:

80 rules that run programs (but do not load modules)

After adding your rule, you need to restart udev.

$ sudo /etc/init.d/udev restart

Next install libnotify-bin through synaptic. This will make it possible for us to show notifies as if it were GNOME itself ;)

Next we’ll need to hack the script a little bit:

Read the rest of this entry »

Written by ruben

March 25th, 2009 at 12:37 pm

Posted in Ubuntu

Tagged with , ,