Abhijit Hiremagalur's blog



Abhijit HiremagalurAbhijit Hiremagalur
Standup 01/16/2009: onReady() for AJAX, Web Sprites & Detecting UTF-8
edit Posted by Abhijit Hiremagalur on Monday January 19, 2009 at 10:09PM

Interesting Things

  • Web based sprite generator - here

This also makes the generated sprite really small which is great if you care about page load times. A Ruby+ImageMagick sprite generator might also be a good thing to build.

  • Cool way of detecting if a file is UTF-8 enconded using Ruby+IConv - here

Ask for Help

"Is there an onReady() for AJAX events?"

Abhijit HiremagalurAbhijit Hiremagalur
Standup 01/13/2009: daemons, encoding
edit Posted by Abhijit Hiremagalur on Tuesday January 13, 2009 at 09:39PM

Ask for Help

"Daemon best practices in Ruby?"

  • We haven't tried DaemonKit
  • SimpleDaemon is what we currently use, which we suspect of interfering with monit (had problems with multiple instances starting, and process not starting upon reboot).
  • A couple of people suggested looking at Daemonize
  • Always monitor daemons with sanity checks (e.g. memory usage); use Monit or God
  • Roll your own?

"cut doesn't handle strange characters in large (5GB) text file, are there other unix commands for text file manipulation that are utf-8 compliant?"

  • Try awk/sed maybe
  • Try using od/hexdump to figure out what the weird characters are

UPDATE 01/14/2009: Chad's corrections

Abhijit HiremagalurAbhijit Hiremagalur
Standup 01/12/2009: require & class reloading, acts_as_fu
edit Posted by Abhijit Hiremagalur on Monday January 12, 2009 at 11:52PM

Interesting Things

  • Using 'require' explicitly interferes with class reloading in Rails

Frederick Cheung discusses this in more detail here. This might be related to the Selenium + class reloading issues some pivots have experienced in recent weeks. The alternative is to rely on Rails automagic loading or 'require_dependency'.

  • acts_as_fu makes writing database independent tests for models is easier

Props to pivot Pat Nakajima for creating acts_as_fu.