Consoles
 

Archive for May, 2009

RailsConf Wrap Up

by Jason LaPorte, May 29th, 2009 at 01:42pm - No Comments »
Tagged As: , , , , , , ,
Posted in: Engineering, Infrastructure

Well, we’re back from Vegas! And have been, for a couple weeks… I’ve been meaning to put up some follow-up resources for my talk (PWN Your Infrastructure: Behind Call of Duty: World at War), but there was just so much work to do when I got back… such is the life of a system administrator!

That said, I’ve got some free moments, so I’m putting up some reference materials.

(more…)

  • Reddit
  • Digg
  • del.icio.us
  • Technorati

Mike and Agora win an award!

by Scott DeMarco, May 22nd, 2009 at 03:06pm - No Comments »
Posted in: News

“The U.S. Small Business Admininstration and the New York Business Development Corp. recognized more than 20 business owners at the 11th Annual Small Business Excellence Awards luncheon at The Desmond Hotel & Conference Center in Colonie.”

http://blogs.timesunion.com/business/?p=12124

Click the picture to see it bigger! (the glass award looks a little dangerous, doesn’t it?  What if Mike tripped on his way down from the podium and the glass tip got stuck in his eye?  I guess that concern falls under the “worrying about something that is unlikely to happen.”  It looks dangerous, though.)

From Left to Right:  Some SBA Guy, Eric from Pioneer Bank (is Awesome), Mike (also Awesome), Some SBA Guy

  • Reddit
  • Digg
  • del.icio.us
  • Technorati

(Ago(ra)ilsconf) – Part II

by Brian Corrigan, May 20th, 2009 at 05:14pm - No Comments »
Posted in: Bending Rails, Engineering, News

Well, we came, we talked, we kicked some … (you know)!

This year Agora had two talks accepted to Railsconf.  Both were received exceedingly well and you can find the slides here.

Congratulations to all of our presenters including: David Czarnecki, Ola Mork, Eric Torrey and Jason LaPorte.  Nice work guys!

  • Reddit
  • Digg
  • del.icio.us
  • Technorati

github.com/agoragames

by David Czarnecki, May 16th, 2009 at 09:30am - No Comments »
Posted in: Engineering, Infrastructure, Online Communities

We are starting to open source some of the components behind community sites like Guitar Hero and Call of Duty. Enjoy!

http://github.com/agoragames

action-mailer-with-temporary-delivery-method
Send email using ActionMailer but without using the templates or changing your smtp_settings

notify-campfire-multi
Notify multiple campfire rooms from a post-commit svn hook

read-and-write-if-nil
Pass through the value of a block to a cache key if the value is nil when it’s requested

test-runner-benchmark
Benchmarking your tests

  • Reddit
  • Digg
  • del.icio.us
  • Technorati

Write if read returns nil

by Ola Mork, May 13th, 2009 at 10:14am - No Comments »
Tagged As: ,
Posted in: Bending Rails, Engineering

Usually we use standard caching methods on our site (primarily fragment caching to avoid DB queries).

Occasionally we need to do something more fancy. These instances usually come up when we’re splitting one query into two because rails doesn’t support :force_index or :adapter_specific_find_options on ActiveRecord::Base.find. We understand this motivation but really hate ActiveRecord::Base.connection#find_by_sql or ActiveRecord::Base.connection#execute. These are not rational hatreds.

So when we get into a situation where we’re going to be caching manually it’s usually in the controller and we almost always end up with a pattern of:

@object = Rails.cache.read('really/complicated/and/stinky/key')
if @object.nil?
@object = what_should_my_object_be?
end

That’s fine in a contrived example but we were doing this in about 10 different places and it looked like a good candidate for drying up.

Here’s the solution we use:

module ActiveSupport
module Cache
class Store
def read_and_write_if_nil(key, options = {})
object = read(key)
if object.nil?
object = yield
write(key, object, options)
end
object
end
end
end
end

And the production example looks like this:

account_ids = Rails.cache.read_and_write_if_nil("member_ids_for_clan_#{@clan.id}", :expires_in => 5.minutes) do
@clan.members.find(:all, :order => 'groupies DESC', :select => 'accounts.id').collect(&:id)
end
  • Reddit
  • Digg
  • del.icio.us
  • Technorati