New Projects

February 5, 2008

In the past couple weeks my curiosity has inspired me to create several new projects. Some are useful, others are simply proof-of-concept. Written in a variety of languages—Javascript, Python and Ruby—the following programs are works in progress. Please try them out and let me know what you think.

(The following web apps probably do not work in Internet Explorer. Darn.)

Campfire to Jabber

At work we use 37signals’ Campfire group chat for our office discussions, as well as customer support. This web-based chat is great for teams to intercommunicate as well as keep the channel open for our customers to speak with us. However, I am not a fan of keeping a couple tabs open to the same pages all day. One reason is that it becomes a RAM hog after a few hours. It also adds another chat program to the list that I have open.

For a while, since I started at Slicehost at least, I’ve been using Pyro, which basically creates a webkit instance specifically wrapped around Campfire. It was buggy but usable until I installed Leopard. Now I find it to crash too often and, again, it becomes a resource hog.

After dealing with Pyro crashing for the umpteenth time I decided to create a proxy between Campfire and Jabber. I built this in Ruby using Tinder and xmpp4r-simple to utilize Campfire and Jabber respectively. It also uses the “daemons” gem to spawn a long-running process. For each Campfire room in which you want to chat, you must also create a Jabber user, which was simple since I run my own Jabber server.

To install, first install the required gems:

sudo gem install tinder xmpp4r-simple daemons

Then place camper.rb in a place you don’t mind seeing .pid files, and configure it accordingly. Keep in mind that you can run several chats from the single configuration. Once configured, you should be able to start and stop the daemon:

ruby camper.rb start
ruby camper.rb stop

This is MIT-Licensed and considered beta software. Please let me know how you like it.

IMGR

I played with the idea of creating a mini-photoshop online. Something akin to Snipshot or Picknik, but in Javascript instead of Flash. I first implemented a simple API using a Django view so that a URL could be called with GET parameters to modify the image using the Python Imaging Library. Then I created a simple javascript interface to update the URL on a page to see the changes. I used Mootools for the brightness, contrast, et cetera sliders.

The name is stupid and hopefully isn’t permanent.

Game

The canvas tag has some cool drawing capabilities. At one point, my friend Nikolaj and I decided to see who could create a SkiFree clone within an hour, using canvas. Our implementations were different, yet showed the power of Javascript.

To that end I decided to create a game using the canvas tag and Javascript. After my first few prototypes it became evident that the utilization of canvas pegged the CPU upwards of 60% in both Safari and Firefox. This was due to redrawing the entire canvas at 30 FPS, though in my opinion each implementation is probably quite inefficient.

In the end I ditched canvas and strictly utilized absolute positioning of divs, which proved significantly less processor intensive. I hit a snag when it came to collision detection—I have no game programming experience, nor college credentials—and postponed production of the project.

Recently I picked it back up, Nikolaj having sent me a link to a brilliant guide on collision detection. So I fleshed out a simple game engine utilizing Mootools’ Class class… Yeah.

The game uses sprites from some NES or Super NES games, though I’m not sure which anymore. Use left and right arrows to move, up to jump. You “die” if you fall off the side.

WebNotes

One day Nikolaj had complained about wanting to take notes for his Slices inside the Slice Manager. I thought this would be useful for all sites so I created a bookmarklet that does just that. Utilizing site-wide cookies, you can save notes for any website you visit. This should be considered a beta application as it’s not yet been around the block, and it should also be noted that your cookies are viewable by any site you visit, so don’t save anything personal or at risk of being stolen. Without further ado, I give you WebNotes.

MusicEr

One of my passions is programming, another is music. In high school I took a music theory class that explained a great deal about the science and formula behind much of music. While I believe real music is about creativity, I believe it possible to create aurally pleasing music automatically. For this project I took Bach’s harmonic tendencies and a Python Midi library to automatically generate semi-random music. This project is in its infancy and should be regarded as proof-of-concept only. That said, the music adheres to Bach’s harmonic tendencies, it still doesn’t sound great. There are many subtleties I’ve yet to implement such as timing and natural crescendos and whatnot. Still, I’m pleased with the results so far.

Canvas Drawer

Lastly a baby application with no practical use: Canvas Drawer. So far you can only create rectangles. Yay! The real action is over at Nikolaj’s Doodler anyhow.


Comments

Don't you have a job? :)

Seriously though, impressive work. I'm envious of the time you get to spend tinkering on this stuff.

Posted by Pete

Add your comment

No HTML; Only URLs and line breaks are converted.