Entries Tagged 'opensource' ↓

Code snippet: weigh by relative importance

It was originally a snippet to do a tag cloud, but I needed to show places on a map. weigh_by_relative_importance now lives as a gist.

Like Semantic Menu, it was developed while working for Bloom Digital, which continues to encourage me to release as open source whatever generic work I do for them.

They are still looking for a junior to intermediate developer; a good opportunity for someone wanting to tackle hard problems with cutting edge technologies.

Rails Semantic Menu Plugin

After Rails Rumble I decided I wanted  to code a plugin to make large menus easier to write. If this interests you, please check Semantic Menu on github.

There is 1 todo left: a default style sheet. That is not something I can do easily, so if you use this project and end up creating CSS for a menu, please share :)

Identi.ca posting via Ubiquity

Ubiquity is a mind-blowing HOLY FUCK. Check out the video here:

http://www.43folders.com/2008/08/27/ubiquity

I followed the command author tutorial to see if I could adapt the Twitter command for Identi.ca. It took me less than an hour to grok Ubiquity and modify the command to work with Identi.ca

Source code lives as a gist on github, and if you have Ubiquity installed you should see a bar at the top of the page inviting you to subscribe to the dent command.

The work involved was trivial, in no small part due to the fact that Identi.ca has a Twitter-compatible API. Most of the “programming” involved was search-and-replace. The fact it’s so easy to do something cool with Ubiquity pretty much guarantees it a bright future.Now watch the pundits go on about Web 3.0. :)

Introducing ActivePresenter

James and I pair-programmed most of ActivePresenter on our way to Rubyfringe. He’s put the finishing touches while on the beach and has an announcement up on his blog.

My first encounter with Presenters was rather confusing - it wasn’t clear to me then that this pattern is overkill for the simpler scenario of saving two related objects. In such cases, validates_associated will do just fine or you can check out attribute_fu.

When those approaches can’t handle your problem - either because you have multiple objects or something other than a parent/child relation - it can really make your code much clearer and keep controllers skinny.

While James and I had a clear idea of what we wanted this library to do, we ended up spending a fair amount of time erasing and re-coding parts of the code until they felt right. One chunk of code got re-written 4 times before we felt it would be easy to read - which we hope you do.

Rails validation plugin

I’ve released another small plugin on github: validations. Only email for now; at the very least URLs should be next.