antimac.org
Dan's homepage
November 12th, 2009, No Comments »

For some reason the key used to set the cookie expiration in Rails changed as of 2.3.  Now you set it like this:

ActionController::Base.session = {
:expire_after => 1.day()
}

I set this in both config/environments/production.rb and in config/environment.rb just in case it matters, and it seems to work: cookies are now being set with an expiration date, where before they were not.


October 29th, 2009, 2 Comments »


October 14th, 2009, No Comments »

My dad gave me a ChatSack base model for my birthday last month.  Here are some pics!

Don’t know what a ChatSack is?  Do yourself a favor and read the Great Outdoor Fight.


October 7th, 2009, No Comments »

Mr. Cryptomail himself blessed us with a starfield simulation that goes down mighty fine with a tall glass of Cosmic Shovel.  Check it out over here; I recommend hitting F11 and sitting back for a flight through the cosmos.

Apologies to IE users, but for as hard as I try to avoid doing things that aren’t supported in the big browsers, this was too cool to pass up.  I hear there is some kind of IE plugin that adds the canvas element though!


October 6th, 2009, 3 Comments »

I’m really glad I spent that weekend-or-whatever-it-was turning the Camel Greasemonkey scripts into a Firefox add-on, because today Lifehacker finally gave up some love for my precious Camel farm.

Their review of that add-on is here.  Seems pretty positive, right?


September 22nd, 2009, No Comments »

I just released a Firefox add-on for the Camel farm, which adds price history charts to the sites of Amazon, Best Buy, and Newegg, and makes it easy to create Camel price watches directly from the product pages of those retailers.

http://blog.camelcamelcamel.com/470/the-camelizer-our-new-firefox-add-on.html


August 23rd, 2009, No Comments »

When trying to generate an OAuth request token, I kept getting a 401 Unauthorized error with moomerman’s twitter_oauth gem.  So I decided to switch to John Nunemaker’s Twitter gem.

This brought about another problem: even if I specified that my Twitter application was web-based and set a callback URL in the app. settings, Twitter kept using the OAuth PIN-based authentication method; I wanted the callback!  The fix involved adding the :o auth_callback parameter to the Twitter::OAuth class, which then gets sent along with the get_request_token() call.

Here’s the monkey-patch:

module Twitter
  class OAuth
    def initialize(ctoken, csecret, options={})
      @ctoken, @csecret, @consumer_options = ctoken, csecret, options

      if options[:sign_in]
        @consumer_options[:authorize_path] =  '/oauth/authenticate'
      end
    end

    def request_token
      @request_token ||= consumer.get_request_token(@consumer_options)
    end
  end
end

I’ll go ahead and slap the old “it works for me” disclaimer on this one. =]


August 15th, 2009, 2 Comments »

A WIFIGHT! chat room viewer and game archive browser.  You can even page through turns!  Not bad for an evening of coding :]


August 12th, 2009, No Comments »

We recently moved from a warehouse in Emeryville to a warehouse juuuuust across the border in Oakland. Naturally, the first thing I did was write a poorly worded letter to the city, vaguely detailing our litter and pothole problems near the new ‘haus. The next morning (this morning, in fact) I received a reply:

Thank you for contacting the Public Works Agency Call Center regarding the email below.  Our street cleaning crew is at the location cleaning up litters and the service request for that is registered as XXXXXX.  Your service request for pothole repair on the YYYY block of Hollis street is registered as ZZZZZZ. Please contact us at (510) 615-5566 if you have further questions.

Who knew complaining to the right people about a problem would help fix it?  Here’s hoping they actually come down and do the work, and that it stays clean!  My theory is that people dump more garbage where there is already a pile, so maybe cleaning it up will resolve the situation.

Afternoon update: the sidewalks are clean and the potholes have been fixed, not even 24 hours after my complaint!  How long until the picture below returns to its garbage dump-y state?


August 11th, 2009, 1 Comment »

Classic!