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
brew update | |
brew versions FORMULA | |
cd `brew --prefix` | |
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
brew install FORMULA | |
brew switch FORMULA VERSION | |
git checkout -- Library/Formula/FORMULA.rb # reset formula | |
## Example: Using Subversion 1.6.17 | |
# |
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
# http://andora.us/blog/2011/03/03/choosing-foreground-using-luminosity-contrast-ratio/ | |
# color contrast ratio ranges from 1 (least) to 21 (most, white/black) | |
class Color | |
attr_reader :r, :g, :b | |
def initialize(hex) | |
raise 'Invalid hex code' unless hex =~ /[0-9a-f]{6}/i | |
hexes = hex.scan /.{2}/ | |
@r,@g,@b = hexes.map { |h| h.hex.to_i } | |
end |