This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
ls = log --graph --color --pretty=\"format:%C(yellow)%h%Creset%C(green)%d%Creset %s %Cblue[%aN]%Creset %C(magenta){%cr}%Creset\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){var l=window.location,u='http://youtube.com/v/'+/v=([A-Za-z0-9][^&]*)(?:&|$)/.exec(l.search)[1]+'?loop=1&autoplay=1';l.replace(u);})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_membership(:user => user) do |m| | |
m.one {|m| do_something_with_one_membership(m) } | |
m.none { oops_no_membership() } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(x:xs) `minus` yys@(y:ys) | |
| x == y = xs `minus` ys | |
| otherwise = x : xs `minus` yys | |
naturals = [1..] | |
evens = [2,4..] | |
odds = naturals `minus` evens | |
{- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
class Foo | |
def parameterfest(one, two, subopts, opts) | |
puts "One: #{one}" | |
puts "Two: #{two}" | |
puts "Subopts: #{subopts.pretty_print_inspect}" | |
puts "Opts: #{opts.pretty_print_inspect}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
module DateDiff | |
module_function | |
def difference_in_months(d1, d2) | |
DateDifference.new(d1,d2).months | |
end | |
class DateDifference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "github", | |
description: "Searchs Github for a code repository", | |
icon: "http://github.com/favicon.ico", | |
author: { name: "Louis J. Scoras", email: "[email protected]"}, | |
license: "MPL,GPL", | |
takes: { "search string": noun_arb_text }, | |
templates: { | |
preview_header: function(q) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TimeMethods | |
def self.define_time(sym, secs) | |
module_eval <<-EOC, __FILE__, __LINE__ | |
def #{sym}; self * #{secs} end | |
alias_method :#{sym}s, :#{sym} | |
EOC | |
end | |
Numeric.send(:include, self) | |
NewerOlder