Skip to content

Instantly share code, notes, and snippets.

View etiennebarrie's full-sized avatar

Étienne Barrié etiennebarrie

View GitHub Profile
[branch]
# git checkout foo automatically checks out origin/foo and names it foo and sets tracking branch.
autosetupmerge = true
# automatically set tracking branch to rebase instead of merge
autosetuprebase = always
[diff]
# automatically detects renames
renames = true
[rebase]
# automatically sets --autosquash when rebasing interactively
class InfoDesk
def trains
:trains
end
def flights
:flights
end
def buses
:buses
end
class Foo
CONST = 42
end
class Bar < Foo
def self.foo
CONST
end
class << self
require 'rubygems'
require 'rspec'
class Sequence
def initialize(*elements)
@elements = elements.sort
end
def elements
@elements.dup
o = Object.new
def o.==(num)
true
end
puts o == 42
puts [o].include?(42)
puts [o].include?("a")
puts [o].include?(nil)
puts [o].include?(Object.new)