Browsing category: Web Development
Handy HTTP requests with Curb and Ruby
June 13th, 2010 in Web Development, Code
While working on one of the projects, i tried to find multi-purpose HTTP request class that can use different network interfaces/ip addresses with retry option (if connection slow or server not responding for some reason). Check out a small class wrapper build on top of Ruby Curb, implemented as a module.
Rails MongoDB logging on Heroku with MongoHQ
June 2nd, 2010 in Web Development, Code
I love Heroku but it only retains your last 100 lines of logs. To save your log output you need to store them outside of the service. MongoDB is "fantastic for logging" and Heroku's MongoHQ add-on makes it easy to spin up a MongoDB instance. The first step is to add the MongoHQ add-on to your app:
$ heroku addons:add mongohq:free
You'll need to include Ruby's MongoDB driver Mongo in your .gems file:
mongodb-mongo --source gems.github.com
Next, install the mongo_db_logger plugin in your rails project (script/plugin install git://github.com/peburrows/mongo_db_logger.git) and include the library in your application controller:
class ApplicationController < ActionController::Base
include MongoDBLogging
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
end
And then, to actually use it in your different environments, add the following line to your app’s "config/#{environment}.rb":
config.logger = MongoLogger.new
Once you've installed the plugin you will have to hard code connection information into the plugin. I edited mongo_logger.rb to connect to MongoDB via Heroku's evironment variable MONGOHQ_URL
begin
@mongo_collection_name = "#{Rails.env}_log"
uri = URI.parse(ENV['MONGOHQ_URL'])
@mongo_connection ||= Mongo::Connection.new(uri.host, uri.port, :auto_reconnect => true).db(uri.path.gsub(/^\//, ''))
@mongo_connection.authenticate(uri.user, uri.password)
# setup the capped collection if it doesn't already exist
unless @mongo_connection.collection_names.include?(@mongo_collection_name)
@mongo_connection.create_collection(@mongo_collection_name, {:capped => true, :size => 10.megabytes})
end
rescue => e
puts "=> !! A connection to mongo could not be established - #{e.message} - the logger will function like a normal ActiveSupport::BufferedLogger !!"
end
To learn more about the mongo_db_logger plugin, read Phil Burrows' article "Rails Logging with MongoDB"
Abi Noda is a software engineer at Doejo and partner at OrangeQC, a software as a service company offering quality control systems for food and janitorial service companies.
![]() |
Abi Noda Software Engineer |
CSS/JQuery navigation with menu items enlarging on hover without shifting adjacent elements
May 29th, 2010 in Web Design, Web Development, Code
Synopsis: Menu (navigation items) are popping out (font-size increased) on hover without pushing/shifting adjacent menu items.
Bonus: How to center navigation of undefined width.

I strongly encourage all web developers (designers, front-end developers or whatever) to solve all layout problems with simple CSS. Only after several hours of lamentation, declaring an anathema on IE6 (and even IE7), you guys are allowed to use a lovely JQuery.
![]() |
Masha Safina Front End Developer & Email Marketing |
Make IE6 respect width (CSS)
May 27th, 2010 in Web Development, Code
What we do to emulate min-width in IE-6? We apply this css to container:
.container {
height:auto !important;
height:200px;
min-height:200px; }
Here's what happens: IE 6 doesn't understand !important, IE6 doesn't know what min-height is, IE6 doesn't care about height or width, it enlarges the container, as much as needed to fit content (css for ie6: min-height = height). So we set auto height for normal browsers, then add height for ie6 (acts like min-height) and true min-height for normal browsers.
If IE6 doesn't respect the height/width, what do we do when we need it to have fixed Height/Width CSS properties?
![]() |
Timur Zaynullin Information Architect & Developer |
Clearly 4G ad campaign a waste of money
May 21st, 2010 in Web Development, Marketing
Clear "Super Fast Mobile Internet" is spending so much money on it's marketing campaigns it hurts me. If we were hired to consult and market the Clearwire Corporation, I would make the "Clear 4G" network public with a secure splash / sales page to garner signups. That way it wouldn't cost so much and you'd reach so many curious people right on their own devices. Just saying, stop wasting so much money. Spend it on feeding people or doing something else, I have been turned off by their marketing efforts from day one. So next time you see a tent or a table selling Clear "Super Fast Mobile Internet" - push it over and laugh.. or run really fast.

Legal Disclaimer
*doejo, llc does not condone destructive behavior unless proven productive.
![]() |
Philip Tadros Founder & CEO |
Javascript router
May 16th, 2010 in Web Development, Code
Let's say you're building a 3-pages website:
- Home
- User Settings -> Profile
- User Settings -> Account
Pretty basic. However, on the front end, you need to implement the following using Javascript:
- Home page should have a carousel;
- User Settings -> Profile should perform an AJAX request immediately after page loads;
- User Settings -> Account should have a carousel, however, this time you must use another carousel plugin.
A non-trivial task and it's really easy to mess up your Javascript code. So, how would you handle this?
Seeking constraints in a web design world
May 11th, 2010 in Web Design, Web Development
Over many beers, and one smashing bout of Checkers with friend and illustrator Jesse Hora, we transparently discussed our love for print design and our ideological positions on web design. The web offers the ease to do complex things in a short period of time. Web design in extremely high demand. It's a cost-effective way for most businesses to speak to their customers. And it's also limitless. The beauty is in it's flexibility.
So, naturally I dig it. At Doejo, we've designed and developed `close to 200+ websites in just under 2 years. I love the versatility with web design. I love the way I can just hop in and rock house in Photoshop, break form and translate to HTML/CSS and post live to a space and open shop. In some cases, within a matter of hours I can sell a product, distribute music, spread an idea. I can launch, take down, relaunch, and tweak to my heart's desire.
But web design also lacks inheritable constraints. Constraints we often take for granted. There are no boundaries, and no end. Unless we create them, we're only bound by... (I am not even sure how to end that sentance.) Print offers immedate contraints. Implications that are permanent, assuming you don't start over.
With web, it's difficult to define the end of a project. Such is why we have ongoing relationships with the majority of our clients. The web is, simply, moving. With print, there is a no-questions-asked end to a project/idea/campaign. It offers the simplicity of just being there. It's interactive, without obligation. And lastly, it's physical. You can take it with you, leave it behind. If you hate it, you can tear it up. If you love it again, you can tape it back together.
We're enamored by the agility in web design. We try to push it's limits, and we act all surprised when we find (again) out that we can do just about anything with it.
We should look to create more constraints in web design. We need to force ourselves to respect the craft, and focus on the fundamentals; color, balance, contrast and use these to create clarity around ideas with the help of typography, illustration, and photography. We should get back to our roots, and get our hands dirty. The web is the most flexible space in the world and I think that's simply badass. But as web designers we should continue to seek constraints, and we can look to print for that
![]() |
Darren Marshall Creative Director |
Yelp, what the zip is up with your algorithm?
May 9th, 2010 in Web Design, Web Development, Misc
I love Yelp and I think their model of being a directory for the people is one of the better ones out there. However, the other day when I was doing a local search to see how web design 60657 appeared I noticed the how inaccurate the zip code location search results are:
![]() |
Philip Tadros Founder & CEO |
Magento: How to add noindex, nofollow robots meta tag or change meta title or description on certain pages
May 1st, 2010 in Web Development, E-Commerce, Code
Here's a small tip on how to modify title, description or add meta robots tag on any magento page via xml layouts or layout updates.
It's obvious how to do that for CMS or products page (on the Meta Data tab). There you can change Meta description or keywords. What about robots meta tag? or changing titles or description on checkout page? You would need to do in case:
- you don't want google to archive your products prices, therefore you would need to add noarchive to robots meta tag
- you don't want duplicate or unnecessary content in search engines, so you would use noindex, follow
- you want to update checkout/contact/send a friend page meta description or title.
The approach is very simple...
![]() |
Timur Zaynullin Information Architect & Developer |
Magento: How to remove certain States from state/region list at Checkout or registration.
April 29th, 2010 in Web Development, E-Commerce
Magento is an e-commerce platform that supports multi-language and all that multi stuff. Therefore list of Regions per country is perfectly legal. The list of regions for USA contains: Alaska, Hawaii, American Samoa, Guam, Marshall Islands, Micronesia and Armed American Forces all over the world. This is the list that is available both during registration and on checkout. There are a lot of store owners/developers/designers who want to remove some of the items from that list. Why?
![]() |
Timur Zaynullin Information Architect & Developer |






































