Luke Wroblewski, Chief Design Architect at Yahoo! and author of “Web Form Design“, published a very interesting post about “Mad Libs” Style Forms and how he improved the conversation of vast.com by 25-40%.
This is how Luke tweaked the contact form:Read the full post: “Mad Libs” Style Form Increases Conversion 25-40%
I wondered whether there...
Read more »
ELC Code
“Mad Libs” Style Forms
Code Readability vs Optimization
There are times when I debate whether to use one-liners or break them out into more readable blocks. Recently I had a situation where I needed to check certain fields on an object depending on the status of other fields.
Let’s say I have a Book object and I wanted to see if it’s...
Read more »
Duck it.
Ruby is not a strongly typed language so we sometimes need to check types explicitly. In a ducktyped world this might be less obvious than you might think. In particular, testing code that is testing input types explicitly can be harder than needed. This morning I came to work with a bunch of spec...
Read more »
The state of Rails plugins
Plugins are great, they help you dry up your code, add features, etc. quickly and easily. But how do you know if a plugin is going to be good, or if it’s outdated completely…..
I usually check the following sites to find out:
http://railsplugins.org/ and http://www.ruby-toolbox.com/
The latter is mostly an overview of gems categorized by what...
Read more »
Using will_paginate in sinatra
Want some sweet pagination on your sinatra app? I know it’s a loaded question with sinatra’s methodology of keeping things slim, but here goes.
There is a framework agnostic branch of mislav-will_paginate on github. What I did was pull that into vendor/gems and added the following code to make it work.
$LOAD_PATH.unshift File.dirname(__FILE__) + '/vendor/gems/will_paginate/lib' #...
Read more »
Installing ruby-filemagic on MacOS X using Homebrew
Homebrew is a new package management system for OS X that supports formulas written in Ruby language.
Here is quick HowTo about creating a new formula for file(1) (You can find the MacPort version here).
First ask brew to create a new formula:
$ brew create file-magic
Then copy the following snippet and replace the file-magic.rb content with...
Read more »
Amazon S3 Versioning Feature
Amazon recently announced the availability of its versioning feature for beta use with its S3 service. Once versioning is enabled for your S3 bucket, Amazon stores each different version of each file as a separate copy in the bucket. Since it’s not a diff, you will have to be aware of the resulting storage...
Read more »
Quick Database Conversion Using taps
taps is a database agnostic import/export gem that works with all the databases that sequel supports, including Amalgalite, ADO, DataObjects, DB2, DBI, Firebird, Informix, JDBC, MySQL, ODBC, OpenBase, Oracle, PostgreSQL and SQLite3. It is also used by Heroku to push and pull your apps databases.
~ % gem install taps
Here is a quick snippet that shows...
Read more »
iPad announced
Finally Apple’s best worst kept secret was confirmed.
I currently own an iPhone and a 13″ macbook pro … so I guess I am yet to see any compelling reason to buy an iPad when released. I know it looks cool, but like what is the killer application for this device?
Read more »
Page Caching JSONP with Nginx and Rack (and Memcached!)
If you’re reading this, you are most likely familiar with the same origin policy, and JSONP’s place in the mix. Working with JSONP is pretty straight-forward, but the small piece of dynamics that it introduces can often hinder the performance you could normally get out of serving content straight from memory or disk. I’m...
Read more »