A Good Ride
Work mates of mine just released A Good Ride, it is a Rails 2.0-based motorbike riding site with some killer features. Check out the ride video feature.
Work mates of mine just released A Good Ride, it is a Rails 2.0-based motorbike riding site with some killer features. Check out the ride video feature.
I love abusing method_missing in Ruby, it is great fun.
module IsDoesIsntDoesnt
def method_missing(method, *args)
m = method.to_s
if (m =~ /^is_(\w*?\?)$/) || (m =~ /^does_(\w*?\?)$/)
real_method = $1.to_sym
return send(real_method, *args) if respond_to?(real_method)
elsif (m =~ /^isnt_(\w*?\?)$/) || (m =~ /^doesnt_(\w*?\?)$/)
real_method = $1.to_sym
return !send(real_method, *args) if respond_to?(real_method)
elsif (m =~ /^(\w*?)s\?$/)
real_method = "#{$1}?".to_sym
return send(real_method, *args) if respond_to?(real_method)
end
super.method_missing(method, *args)
end
end
Object.class_eval() do
include IsDoesIsntDoesnt
end
Which lends itself to these types of natural statements:
?> "team".includes?("i")
=> false
>> "team".isnt_empty? => true
and:
>> [].is_empty? => true
>> [ :stuff ].does_include?(:stuff) => true
While I’m sure Ruby mavens will think of much nicer ways to implement this type of functionality, I had fun doing it.
An exercise for the reader would be to dynamically add the appropriate method, so the next call doesn’t rely on method_missing.
Home sweet home! ;-)
My cell phone number while in Israel is +972-54-4399-8I3 (O54-4399813 from Israel). Replace O with zero, and I with 1 (changed to avoid SMS spam). I’m not sure if I can reply to international SMS from this number, though.
Just spoke to El-Al’s Bangkok office and they said that there is a good chance that I’ll be able to board the flight, so I’m going to grab brunch and head off to the airport. I’ll be in stand-by, but hopefully I’ll get on the flight.
Hope to see some of you tonight ;p
Firstly, please don’t SMS me here unless it is important. It costs me almost $2 per SMS sent and received.
Secondly, to clarify any emails I may have sent — I’m arriving either on the 3rd, or the 6th of September, with El-Al flight LY84, which lands at 23:20 at Terminal 3. I’ll let you all know here if I arrive on the earlier flight.
Arrived late last night into the hot, humid and polluted swamp that is Bangkok. I don’t dislike this city, but I very much hope I can get on the earlier flight to Israel (3rd of September) because I seriously don’t know how I’ll spend the time here until the 6th. Its too little time to go to the farther islands by plane and it is not quite the season either. Someone recommended Koh Samet to me but even that relatively close island is a almost day of traveling each way.
I have found a nice day tour to a tiger park where I hopefully will get to play with cub tigers ;p… I’ll book it today probably. If I become their lunch then they’ll get a heart attack.
Tonight I’ll go check out the Bangkok weekend nightlife, should be a riot. Hope I’ll find fellow travelers to hang out with.
I’m not even within a week’s radius of landing in Israel and already I’m pissed at Israelis again.
Why? Because while sitting at the airport waiting for my flight I hear that every time they page for late passengers there are always Israeli names included, always. Do you realize how small the percentage of passengers are Israeli? Yet they are the star of the show when it comes to rampant disregard to anyone aside of themselves.
Passengers Vardi, Shavit, Egoz, Ronen and co., please get your lazy asses out of the duty free store and onto the bloody plane on time!