Disney To Cut Emissions By Half In Four Years

Posted on March 09, 2009

This is the kind of article that I love. Disney pledging aggressive (seemingly) targets for consuming less power across their fleet of theme parks. What’s fascinating about this is that it’s a giant optimization problem, and that environmental concerns are directly in line with operating costs. Use less power == spend less money == save the planet. It’s win-win. And since the scale of WDW is mind-boggling (for example, WDW is the largest single-site employer in the US). So if you change the bathroom light bulbs to CFLs across 28,000 rooms on property, it’s going to have a measurable impact on your bottom-line. This would be an awesome contract for a environmental consulting firm.

The tricky part is when the lowest hanging fruit gets picked, or when they’ve already eliminated the biggest sources of waste. A NYT article on Walmart brought this up, that while Walmart has done great stuff with light bulbs and condensed laundry detergent, think of the dizzying array of products it could make green through the weight of its purchasing power. So when Disney runs out of obvious optimizations, it then has to make tougher economic decisions during what’s bound to be a tough economic period for tourism. Do they cut Wishes to 3 nights a week due to its environmental impact? Do they spend money to upgrade their buses to biodiesel?

Two salient points here: 1) it’s going to be interesting to see what happens to big company environmental efforts with a worsening economy (not that original of a point). 2) Let me just reiterate that how much fun this kind of optimization would be at a company of this scale. You help save the planet, make the company a ton of moolah, work with new, green technology, and go to disney theme parks. What a job.

UPDATE: John Frost has some notes on Disney’s newly released Corporate Responsibility Report.

reCAPTCHA on Rails

Posted on March 08, 2009

This has probably been done to death, but for the sake of Random Google Searches (RGSs), here is a quick run through about how to do reCAPTCHA with Rails.

First off, you need to register at recaptcha.net. Then you need to add your domain and get two keys (one public, one private). I created two sites once registered, one for my development environment (localhost), and one for production.

Second, there is a Rails plugin. It’s on GitHub. So install it like this:

$ ./script/plugin install git://github.com/ambethia/recaptcha.git

Third, take those public and private reCAPTCHA keys and place those suckers in your environment.rb or appropriate environment file. Here’s what I added to the bottom of my development.rb, replacing the ‘MY_PUBLIC_KEY’ and ‘MY_PRIVATE_KEY’ with the keys from recaptcha.net (but keep the single quotes):


ENV['RECAPTCHA_PUBLIC_KEY'] = 'MY_PUBLIC_KEY'
ENV['RECAPTCHA_PRIVATE_KEY'] = 'MY_PRIVATE_KEY'

Fourth, find the place in your views where you want the reCAPTCHA box to appear. The plugin defines a special view helper named recaptcha_tags. Here’s a basic example:

Ask a Question -- Get an Answer!

<% form_for(@question) do |f| %>
Question: <%= f.text_field :question %>
Human Test: <%= recaptcha_tags %>
<%= f.submit "Ask Question" %>
<% end %>

And here’s what it that basic html looks like:

Each page load will embed code that pings the reCAPTCHA API and generates a new captcha. Note that there are some extra options on recaptcha_tags if you need to handle ssl or want to by default not use javascript (uses an iframe instead).

Lastly, we have to handle the verification in the controller. Here’s how I integrated it:


def create
@question = Question.new(params[:question])
if verify_recaptcha() and @question.save
redirect_to :action => 'show', :permalink => @question.permalink
else
render :action => 'new'
end
end

The verify_recaptcha() method will take params from the POST request, ping recaptcha.net, and then return true or false. Then you can handle it however you want (here in the same block as model validation). If the captcha fails, it’ll render the new page again, where a small error message will show up in the reCAPTCHA box.

And that’s about it. Hat tip to Rob Olson for implementing this originally on Elevator Pitches (I checked out that implementation first).

The Long Huck => hwork.org

Posted on March 06, 2009

Finally made the switch from Blogger to WordPress.

All links are now redirected. The feed is now redirected (and hosted on feedburner). I’ve been working with WordPress for over a year now, and so I finally thought I should switch to it for myself.

Twitter Domain Duplicate Content Issues

Posted on March 06, 2009

Found this issue when vanity searching for ‘hwork‘, my bowdoin handed-out internet alias. Turns out that twitter maintains three (at least) different subdomains for each user that are all crawlable by google: twitter.com/hwork, http://m.twitter.com/hwork, and explore.twitter.com/hwork. The first is obviously the main site (they redirect all requests from www.twitter.com/* to twitter.com), the second is the mobile site (which they redirect you to if you connect via a mobile user-agent). The third I don’t recognize. But it’s literally the exact same content as the normal domain (maybe some differences based on your session data).

Anyways, the solution for Twitter to fix this is really simple. Just disallow all URLs via robots.txt on the m.twitter.com and explore.twitter.com domains. http://m.twitter.com/robots.txt should look like:

User-agent: *
Disallow: /

This should remove a ton of duplicate twitter urls from goog. According to the SEO for Firefox plugin, Ev’s regular twitter page as a pagerank of 7, while the mobile version of his page only has a pagerank of 4. Interestingly, ev’s explore domain page also has a pagerank of 7.

Update: Found another dupe content domain, here: http://api.twitter.com/hwork.

Disney World Advice

Posted on February 12, 2009

OK, I know, I get it–my haunting disney obsession is lame. But if I’m going to be an Imagineer one day, I’ve got to keep the 3-4 people who still read my blog abreast of Disney happenings. First, you’ve got to checkout the Unofficial Guide to Disney World‘s website. Specifically, you should check out their disney websites page. If you’re extremely badass, you’ve gotta peep the Ultimate Magic Kingdom Touring Plan — it’s a guide to visiting all 43 attractions at the Magic Kingdom in one day. Also, if you’re planning a trip, you should check out their Crowd Calendar. More later.

Two very nice additions in Edge Rails

Posted on July 07, 2008

Though we still haven’t upgraded to Rails 2.1 on our main project (CrunchBase) — yes, I know, it’s lame — two nice additions have come along in Edge Rails that will make my life easier.

The first is from the fine blog of Ryan (I wish it was updated more often): Collection Partial Variable naming. Ryan says that this is from the “little-but-useful department” — I think it’s totally sweet. I’ll actually use the @collection trick more often now.

Second is a trick for ActiveRecord — you can now easily stay ruby-fied when you execute a join. Scroll down. It’s pretty sweet.

MAMP + CocoaMySQL

Posted on May 20, 2008

OK so this took me more than a minute to figure out, so I wanted to bump this answer for future google searches:

If you’re using MAMP and want to check out any databases created via applications run in MAMP, do this:

Host: localhost
User: root
Password: root
Database: [blank] (unless you know the db name)
Socket: /Applications/MAMP/tmp/mysql/mysql.sock
Port: 8889

Getting the socket right was the tricky thing for me. Hope this helps.

Flickr Video Embed

Posted on April 09, 2008

Taken in MGM Studios in December, 2007.

Hacking Bagel Buys at CBR

Posted on March 22, 2008

Inspired by a how to get coffee in MK post and the saving time podcast over at WDW Today, I wanted to address the sincere and growing concern of Caribbean Beach Resort denizens over queue length at the OPR bagel shop.

This is the small cafeteria section of Old Port Royale, the shining hallmark of Disney’s resort food joints. It’s got bagels, beer, fruit cups, but only one cash register. What the yay, yo? The line is near bursting when I get in the morning.

But I have a hack for this. See, there are other cash registers at OPR. There are many other cash registers at OPR. Here they are:

Nefariously or not, I abandon the line attached to the former small bodega and join this checkout line corral for the other small quick-service counters. There is always a CM named Jane, Jorge, or Jess that’s happy to charge you $14 for a bagel and OJ. This honestly saved me more than 10 minutes each morning.

BBC: Mexico gang had ‘James Bond’ car

Posted on March 20, 2008

Actual photo captain from Mexico gang had ‘James Bond’ car:

Most Jeep Cherokees do not boast police-defying smoke machines