Skip to content

Instantly share code, notes, and snippets.

View tralston's full-sized avatar

Taylor Ralston tralston

  • Sacramento, CA
  • 23:40 (UTC -07:00)
View GitHub Profile
@tralston
tralston / commands.sh
Last active December 26, 2015 19:39
Bash Commands (Mac OS X)
# Find the MD5 sum of the current directory
find . -type f -not -path "./.git/*" -print0 | xargs -0 md5 | md5
@tralston
tralston / bundler.sh
Created October 21, 2013 18:54
Bundler commands
# List all the gems and versions used in your rails project
bundle show
# Use this to list an individual gem's location. Note that the regular "bundle show" doesn't tell you when a dependency is broken
bundle show <gem>
# Perform "bundle show <gem>" but for all the gems
bundle show | sed -e 's/ \* //g' | sed -e 's/ (.*//g' | xargs -I {} bundle show {}
# Try using bundle install
@tralston
tralston / rugygems.sh
Last active December 26, 2015 00:19
Ruby gem commands
# Remove unused gems, clean up broken dependencies
# Use with bundle show <gem> to resolve LoadError problems for gems that are installed but not seen by Rails
gem clean <gem>
# Remove accumulated gem documentation (ri and rdoc)
rm -r `gem env gemdir`/doc
@tralston
tralston / Problem #1.rb
Last active December 16, 2015 01:49
Project Euler: Problem 1
solution = 0
(1...1000).each do |n|
if n % 3 == 0 or n % 5 == 0
solution += n
end
end
solution