1
2
3
4
puts '1'
puts '2'
puts 'buzz'
...

Ruby On Challenge: Ugliest Ruby Fiz...

by Gary Haran, December 20, 2007 22:23 Star_fullStar_fullStar_full

Mine runs faster than yours

403e57e2be130d2218f992b86dfa8260 Talk

JavaScript On I care about older browsers...

by Gary Haran, October 31, 2007 14:59

No sir. This was client si...

403e57e2be130d2218f992b86dfa8260 Talk
1
2
3
document.write ('<noscript>\n');
document.write (imageClick);
document.write ("</noscript>");

JavaScript I care about older browsers...

by Gary Haran, October 30, 2007 22:30, 3 refactorings

I found this great piece of...

403e57e2be130d2218f992b86dfa8260 Talk
1
2
3
4
# W/ Prototype and W/out currying
$(imgID).observe("mouseover", 
  function(event) {
...

JavaScript On Curry

by Gary Haran, October 30, 2007 15:41 Star_fullStar_fullStar_fullStar_full

I would use bindAsEventList...

403e57e2be130d2218f992b86dfa8260 Talk

JavaScript On Random URL

by Gary Haran, October 30, 2007 15:32

I much prefer Fu86's refact...

403e57e2be130d2218f992b86dfa8260 Talk
1
2
3
4
class String 
  def postal?  
    self.match(/[a-zA-Z]{1}\d{1}[a-zA-Z]{1}([\x20-])*\d{1}[a-zA-Z]{1}\d{1}/) ? true : false
...

Ruby Is This String Postal?

by Gary Haran, October 30, 2007 15:29, 6 refactorings, tagged with string, class, postal

We've had the debate over w...

403e57e2be130d2218f992b86dfa8260 Talk
1
2
3
4
p = Proc.new { |en, fr| lang.to_s == "en" ? en : fr }
breaker = case location_type
  when 'point'
...

Ruby On Iffy

by Gary Haran, October 11, 2007 19:55 Star_fullStar_full

in the middle of all of thi...

403e57e2be130d2218f992b86dfa8260 Talk
1
2
3
4
if self.location_type.to_s == 'point'
  breaker = self.lang == 'fr' ? 'proximite' : 'near'
 else  
...

Ruby Iffy

by Gary Haran, October 11, 2007 19:15, 6 refactorings

With all the magic surround...

403e57e2be130d2218f992b86dfa8260 Talk
1
2
3
4
Object.extend(Date.prototype, {
  isLeap: function(){
    var year = this.getFullYear();
...

JavaScript On Is this year a leap year?

by Gary Haran, September 21, 2007 08:05 Star_fullStar_fullStar_fullStar_full

Indeed we could remove one ...

403e57e2be130d2218f992b86dfa8260 Talk
1
2
3
4
Object.extend(Date.prototype, {
  isLeap: function(){
    var year = this.getFullYear();
...

JavaScript Is this year a leap year?

by Gary Haran, September 21, 2007 07:16, 11 refactorings

I'm pretty sure we can figu...

403e57e2be130d2218f992b86dfa8260 Talk
1
2
3
for i in (1..10)
  puts i
end

Ruby On Ruby simple loop

by Gary Haran, September 18, 2007 10:26 Star_fullStar_fullStar_full

definitely less keystrokes

403e57e2be130d2218f992b86dfa8260 Talk
1
2
3
4
String.prototype.hello = function(){
  alert('hello world!');
}
...

JavaScript Hello World

by Gary Haran, September 17, 2007 13:09, 1 refactoring

This is simply to test out ...

403e57e2be130d2218f992b86dfa8260 Talk