life.i.think -

Giveth before you Taketh
Scribbled on February 27th. 2 comments.

It’s commonality on the web. A site asks you for something you consider sacred (it’s a strong word, I know): your email, your username, your password, before it gives something useful back to you. Sure, it may give you view-only access to information, but in order to actually participate in a community, you have to supply them with something first.

But what if this didn’t have to be the case? What if it shouldn’t be the case? A web application should be giving, loving, and excited about its users, even if they aren’t already defined by a particular identity. The web, at its heart, is largely anonymous. Sure, it knows things about you without your consent: your browser, your IP, your location, whether or not you have flash, etc, etc. But the web doesn’t know you; you as a person. If you are most webapps (you know who you are), then you ask the user to give this up, oftentimes before showing them what exactly they’ll be getting in return.

You are standing at a bar, hanging out with a variety of webapps.

Sitting next to you are some people you have heard of before (hey, they have a rep!): Digg, Gmail, Flickr. You’re an outgoing person, and you’ve heard about how amazing these people are, so you introduce yourself.

But to your left is a newcomer. Maybe they’re respectable looking, maybe they’re not. Maybe you’re immediately intrigued by their mystique, instantly wanting to get to know them. Maybe you’re not. Now in a perfect world, everyone would introduce themselves to everyone and immediately get along famously, becoming instant friends. Unfortunately, that’s not the world we live in, and nor is it the web at large. There are people who want to know you for their own benefit. So you’re jaded, and quietly sit there sipping your appletini.

But what if they turned to you and and started telling you a fantastic story, something about themselves that you would have never gleamed at first sight, especially in a bar as big as this one. You talk back and forth for a while, entertaining each-other with common interests and tales of the good-ol’-days, and eventually it comes out.

“Hey, by the way, my name is Britt.”
“Oh hi, I’m Twitter.”

And there it is. The beginning of a beautiful relationship.

Use what you develop, love what you develop.
Scribbled on February 15th. 2 comments.

If you don’t already read Kathy Sierra’s Creating Passionate Users, you most probably should!

Her Valentines day post (linked above), was on “Loveocracy” and how what’s good for the user is good for you. I’d like to add something that she implied in the post, but didn’t mention specifically.

Not only do you want passionate users, but passionate developers. It seems obvious, and should go without saying, but is very important. Love the software you write. USE the software you write! In an ideal world we, as developers, could love every application we create. Unfortunately for some, especially in the case of contract development, this isn’t always the case. But whenever possible, one is blessed with working on an application that they not only enjoy developing, but using as well. When you care about something, you nurture it. In the software world, this means more creative and intuitive applications, which are ultimately well written with fewer bugs.

In the end, don’t simply create passionate users, but be one yourself.

html2comatose - Importing HTML into the Comatose MicroCMS
Scribbled on February 13th. 0 comments.

Well, you don’t see this every day.

One client of ours wants to add some shopping cart jazz to a few of his websites. Nothing new here, especially since we’ve developed our own kick ass shopping cart. The oddity is that he wants most of the static content of some very old-school sites imported in pure HTML form to a CMS for online editing. No layouts or cleanup, just the old, pure HTML. Actually, one of the sites used image maps for navigation (the whole page is solely images!), so we are doing a bit of cleanup there.

Comatose is a nice ‘microCMS’ that sits happily ontop of an existing Rails app. Today I whipped up a script to import a static site into comatose.

It’s not much … you can download it here. Usage is simple:


html2Comatose: Import HTML into the Comatose MicroCMS

        Usage: ./html2comatose app-root html_pages_root [additional extensions you'd like to import]
        Example: html2Comatose ~/devel/myapp ~/var/www/httpdocs php rhtml

After the import is complete, you’ll want to put something like this in your /config/routes.rb ..


map.comatose_admin
map.comatose_root '/site', :layout => nil
map.connect '', :controller => 'comatose', :action => 'show', :index => '', :page => 'index'

Haha, I’m not sure if anyone will every find a need for this, but let me know if you end up using it for anything.

Userscripts.org ... 2!
Scribbled on February 13th. 1 comment.

They grow up so fast! After much hubbub and a bit of general hurah, the first stage in the major Userscripts.org rewrite has been released!

Thanks to all that helped make this possible!

life.i.think
Scribbled on February 9th. 0 comments.

“You are not here merely to make a living. You are here in order to allow the world to live more amply, with greater vision, with a finer spirit of hope and achievement. You are here to enrich the world, and you impoverish yourself if you forget the errand.”

- Woodrow Wilson.

GD on OSX and Ruby (stringFT)
Scribbled on February 6th. 0 comments.

After going through the process of building GD in OSX with all the relevant fonts, libraries and what-have-you, I was running into a terribly frustrating problem with Ruby-GD, specifically when trying to use the Captcha gem.


undefined method `stringFT' for GD::Image:Class

Luckily, this can be fixed very simply by:


sudo port install rb-gd

Javascript Conditionals in RJS
Scribbled on February 5th. 1 comment.

Every so often one has the desperate need beat RJS into evaluating javascript conditionals, say, if you don’t know if an element is going to necessarily be on the page or not.

For this one particular use case, luckily, Enrico Franchi pointed out a workaround for this.


page.select('element').each do |element|
  page.replace_html element, replacement
end

But what if we want to compare equality, or any other type of conditional? We can use the unbelievably, ridiculously, mind bogglingly ugly hack:


page << 'if (el.value == 10) {'
  page['block'].replace_html replacement
page << '} else {'
  page['block'].replace_html replacement
page << '}'

Imagine if we needed both of these previous methods combined? My head is spinning!

Dann Webb provides a plugin that implements ejs (erb based javascript) that provides a very cool and interesting mesh between javascript and erb.

But tell me. Why, oh why, wasn’t this patch accepted?