In my free time
I'm writing software
Posted by
In my free time I am often writing or tweaking some open source software. Today I would like you all to meet two of them.
Plistifier
Plistifier is my first Ruby on Rails plugin which allows you to use binary Property Lists, such ones like Apple uses for all kinds of stuff, to send to your client. Mostly it is a cool thing for iPhone developers who have to talk to a server to get some data. But it is the same little effort for desktop OS X applications.
The cool thing about it is, that you just need one line on each side, server and client, to get them to communicate. Lets say you have a PostsController and a Post model in your rails application. And you would like to get a list of post items on your iPhone to show them in your UITableView. So after you installed the plugin, you have to add this line to your controller:
format.plist { render :plist => @posts }
And in your iPhone controller you add this:
NSURL *url = [NSURL URLWithString:@"http://example.com/posts.plist"]; NSArray *posts = [[NSArray alloc] initWithContentsOfURL:url]; NSLog(@"Title: %@", [[posts objectAtIndex:0] objectForKey:@"title"]);
The second line is the one which does all the work, it gets the data from the network, parses it and saves it as a native NSArray in the variable posts. Thats it, you're done, no SAX-parser, no JSON-frameworks, nothing. And its fast, the binary format is very efficient, it reduces the size down to 1/10 of the verbose XML variant.
The plugin uses Christian Kruses CFPropertyList to generate the plists and is based on chuyeows jsonifier. Thank you guys for releasing the stuff open source, you rock!
Timr
Timr is a simple timer or count down for OS X. Just today I released a new version of it which finally looks nice and polished.
I often forget somethin in or on the oven, once I even started a fire in the kitchen just because I forgot the oil on the cooking oil and sat by the computer and just surfed the web.
But such kind of things doesn't happen to me anymore because I just set the timer alarm to for example 30 minutes and get a annoying sound when it's time to get the pizza out.
I hope you like some of my applications, I will present some of the other ones in the future :-).
1 Mention
Repairing your stuff I'm doing it myself
Today I fixed my laptop