Skip to content

Instantly share code, notes, and snippets.

View koriroys's full-sized avatar
🐢
Slow and Steady

Kori Roys koriroys

🐢
Slow and Steady
View GitHub Profile
@koriroys
koriroys / .gitconfig
Created April 20, 2012 02:30
pretty print for git log
[alias]
lg = log --graph --pretty=format:\"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\" --abbrev-commit --date=relative --max-count=50
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
@koriroys
koriroys / .gitconfig
Created May 2, 2012 23:53
my git config
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%Cred%h %ad%Creset | %s%d %Cred[%an]\" --graph --date=short
lg = log --graph --pretty=format:\"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\" --abbrev-commit --date=relative --max-count=50
type = cat-file -t
dump = cat-file -p
[core]
@koriroys
koriroys / .rbenv-version
Created May 12, 2012 18:04 — forked from JoshCheek/README.md
Challenge to create your own struct
1.9.2-p290
@koriroys
koriroys / .irbrc
Created June 13, 2012 16:04
irb history save
#!/user/bin/env ruby
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 1000
@koriroys
koriroys / Gemfile
Created June 29, 2012 19:45 — forked from ralphos/gist:3018324
UniqueArray Problem
source 'https://rubygems.org'
gem 'rspec', '2.11.0'
@koriroys
koriroys / splat.rb
Created July 23, 2012 21:33
Splatting ranges and zipping hashes
Hash[[*'a'..'e'].zip [*1..5]] # => {"a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5}
@koriroys
koriroys / bin.rb
Created July 30, 2012 17:46
Binary patterns
MAX = 64
zero_fill = MAX.to_s(2).size
[*0..MAX].each do |num|
puts "%#{zero_fill}d" % num.to_s(2) + " - #{num}"
end
source "http://rubygems.org"
gem "rspec"
@koriroys
koriroys / run_test1.rb
Created September 20, 2012 22:25
It's a Tarp!
# encoding: utf-8
require File.join(File.dirname(__FILE__), 'test1')
puts "1: #{ Test::One.sort([4, 1, 5.5, 600_000]) }"
puts "2: #{ Test::Two.what_am_i }"
Test::Three.extend_string
puts "3: #{ "Hello".to_s }"
puts "4: #{ Test::Four.extend_vs_include }"
puts "5: #{ Test::Five.reverse('reverse me') }"
puts "6: #{ Test::Six.divide_hash }"