Merb, jQuery and Nitobi

Recently, we reached a milestone with our first Merb project. The project was interesting, since it was the largest Merb app that we had to deal with. The good thing about Merb was the fact that it’s lightweight, and gives you a sense of what you’re actually using as opposed to Rails, which is full of methods that I just don’t use. I also like the way file uploads are just handled in Merb, as opposed to the Rails way, which is far more cryptic.

The fact that whenever you post data, it just goes to the following parameter:

params[:file][:tempfile]

Is extremely handy, since this doesn’t have to be handled like the good old ruby way of handling blob data through your app. You still have to move the file, but you aren’t just being handed some weird data in memory and expected to use something to process it. This is why people use plugins like attachment_fu and things like that. The less your web app is handling that sort of data, the more requests that it can handle, and the more things it can get done.

Of course, that’s the whole point of Merb. Admittedly, we don’t take advantage of this as much as we could have in this project. We have Rails projects that handle hundreds of uploads that would probably be more suited for Merb, but of course hindsight is almost always 20/20 and it’s time to move on to talk about jQuery and Nitobi Toolkit.

Since this was an experimental project of sorts, I decided to try out jQuery to see what all the hype was about. jQuery is a nice little framework that makes doing simple things like Ajax requests easy. Attaching events to classes is handy, and that is the fundamental strength of the framework. Also, using jQuery UI was interesting as well. While making things appear and disappear was easy, some of the components tended to be ugly, and lacked functionality, so we decided to use Nitobi Calendar instead of the jQuery calendar early on.

This brought us into bringing in Nitobi Toolkit and Nitobi Calendar and making it play nice with jQuery. We learned the number one thing about jQuery, which is that you should always use noConflict if you believe that you are going to use more than one framework. In our case, we use both the Calendar and the Nitobi History object, simply because of the lack of examples of the jQuery.history object, and the fact that it relied on Anchor tags in the examples. It wasn’t clear if we could custom define the URI behind the scenes, and use that instead of something defined in the markup, which is exactly what we wanted to do.

Therefore, we used Toolkit’s history method, and it worked rather well. I may check out jQuery’s History add-on library, but the Nitobi history comes standard in Complete UI and is rather easy to use. There will be some tweaks to it in the next version of CUI.

In short, it was an interesting expeirence working on the project, and being able to work with Merb. I’m definitely going to move towards Merb, and it should be good when Merb 1.0 comes out at MerbCamp in San Diego. Unfortunately, it’s at the same time as Canadian Thanksgiving, but there may be at least one person from Nitobi present.

There may not necessarily be a MerbDog soon, but It’s definitely my first choice for any new personal web projects that I do.

Introducing VHS

Recently, I’ve been talking about VHS. VHS is an acronym, which now stands for Vancouver Hacker Space.

The Vancouver Hacker Space is a project that I’ve been working on for a while. It was started with the FreeTheNet.ca people at The Vault, which was in the BC Electric Building. However, we didn’t quite have critical mass, since people were still uber-psyched about FreeTheNet (note: VONIC is still around, I’m just taking a break from it). However, after I went to The Last HOPE in NYC and met up with the people at NYC Resistor and HacDC, among other Hackerspaces, I decided that Vancouver really needs a hackerspace.

Now, Hackerspaces aren’t anything new, in fact Germany has had them for years. In fact, Andre has been to c-base, which is one of the older Hackerspaces in Germany that double as a nightclub. The hackerspaces are all over Germany and they are run by the CCC, who are a damn cool group, with a really interesting history.

Anyway, this is interesting because there will finally be a place where people can collaborate and see different hack projects. For example, I had a multitouch interface that worked, but the problem was getting it out of the apartment to Nitobi Hack Days. With the new hackspace, interested hackers can go check out the thing in action, and the public can see it. (And as much as I like people, I don’t want them coming into my apartment randomly). We’ll also be working on Arduino hacking, and Robots, and LED Throwies and all sorts of other cool stuff.

The first public meeting is tonight at the hackerspace. The meeting will be at 6:30 PM. If you’re interested in getting more info, please let me know.