Skip to content

Instantly share code, notes, and snippets.

View ljsc's full-sized avatar

Lou Scoras ljsc

  • Bloomberg LP
  • Washington, DC
View GitHub Profile
@ljsc
ljsc / snippet.rb
Created November 20, 2008 21:18 — forked from anonymous/snippet.rb
require 'date'
module DateDiff
module_function
def difference_in_months(d1, d2)
DateDifference.new(d1,d2).months
end
class DateDifference
@ljsc
ljsc / quiz.rb
Created May 15, 2009 18:57 — forked from ryanb/quiz.rb
# COMMUNITY CHALLENGE
#
# Here's my (@ljsc) solution. I guess this would qualifiy as a mock.
#
class Quiz
def initialize(input = STDIN, output = STDOUT)
@input = input
@output = output
end
@ljsc
ljsc / gist:5816855
Last active December 18, 2015 17:09 — forked from richmolj/gist:5811358
Add factory method.
class Post
# Make the DI overhead a bit more bareable with a factory method. You can
# still use the default constructor if you need the extra flexibility.
#
# I'm not quite sure about this last parameter though for the should_order.
# Most of the time passing a boolean is a code smell that you have some unwanted
# control coupling...
#
def self.standard_post(should_order)
alarm_handler = AlarmHandler.new(:post_search)

Stephen's Shitlist

Person/Place/Thing Shit-storm level (tm)
Obama / Healthcare ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
ERB and HAML templates ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
Matt Newton Metaprogramming ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
T-Mobile ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
John ![1][poo]

Stephen's Shitlist

Person/Place/Thing Shit-storm level (tm)
Obama / Healthcare ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
ERB and HAML templates ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
Matt Newton Metaprogramming ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
T-Mobile ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
John ![1][poo]
Ruby Hash Rockets ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]