Saturday, May 31, 2008

Silly Mii

My talk for barcamplondon4 was "Silly Mii". It's a few ideas I had for silly things to do with the wii-mote. The program includes a simple persistence of vision LED message bar and an 'invisible instrument'. The invisible instrument supports up to four IR sources to play sounds.
Presentation
Program

Wednesday, May 21, 2008

Ruby: Debugging backticks

I needed to knock up a Ruby script recently that orchestrated some external processes using backticks. However something was going wrong and I need to temporarily peek into the inputs and outputs of the external programs. Ruby bend-ability to the rescue:
module Kernel
  alias_method :real_backticks, :'`'

  def `(cmd) 
    puts "`#{cmd}` => #{output = real_backticks(cmd)}"
    output
  end
end