This file contains hidden or 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
| # has_each, has_any, and has_none extension to Array. | |
| # | |
| class Array | |
| # Returns true is array contains each item in the argument list. | |
| # | |
| # Basic Usage: | |
| # | |
| # [:black, :blue].has_each :black # => true | |
| # [:black, :blue].has_each :black, :red # => false |
This file contains hidden or 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
| # Use .eq where you would use ==. Avoid accidental assignment. | |
| # | |
| # if 1.eq 1 | |
| # puts "They're equal" | |
| # end | |
| # | |
| class Object | |
| def eq(operand) | |
| self == operand | |
| end |
This file contains hidden or 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
| # all_in, any_in, and none_in extension to Array. | |
| # | |
| class Array | |
| # Returns true if the argument list contain every item of the array. | |
| # | |
| # Basic Usage: | |
| # | |
| # [:black, :blue].all_in :black, :blue # => true | |
| # [:black].all_in :black, :red # => true |
This file contains hidden or 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
| # all_in, any_in, and none_in extension to Array. | |
| # | |
| module Enumerable | |
| # Returns true if the argument list contain every item of the array. | |
| # | |
| # Basic Usage: | |
| # | |
| # [:black, :blue].all_in :black, :blue # => true | |
| # [:black].all_in :black, :red # => true |
This file contains hidden or 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
| # Example: | |
| # | |
| # 2.of { Factory(:user) } #=> [<User>, <User>] | |
| # | |
| class Fixnum | |
| def of | |
| (1..self).map { |n| yield n } | |
| end | |
| end |
This file contains hidden or 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
| # Add this to the end of your development.rb and add | |
| # | |
| # gem 'pry' | |
| # | |
| # to your Gemfile and run bundle to install. | |
| silence_warnings do | |
| begin | |
| require 'pry' | |
| IRB = Pry |
This file contains hidden or 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 all='git for-each-ref --count=400 --sort=-committerdate refs/heads/ --format='"'"'printf "%%-40s %%4d behind\t%%4d ahead\t%%-20s\t%%30s\n" "$(echo %(refname) | cut -d / -f 3-)" "$(echo $(git log %(objectname)..head --oneline | wc -l))" "$(git log head..%(objectname) --oneline | wc -l)" "%(authorname)" "%(authordate)"'"'"' | $SHELL | less' |
This file contains hidden or 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
| # install git | |
| sudo apt-get install g++ curl libssl-dev apache2-utils | |
| sudo apt-get install git-core | |
| # download the Node source, compile and install it | |
| git clone https://github.com/joyent/node.git | |
| cd node | |
| ./configure | |
| make | |
| sudo make install | |
| # install the Node package manager for later use |
This file contains hidden or 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
| ## | |
| # Host Database | |
| # | |
| # localhost is used to configure the loopback interface | |
| # when the system is booting. Do not change this entry. | |
| ## | |
| 127.0.0.1 localhost | |
| 127.0.0.1 localhooker | |
| 127.0.0.1 locohost |
This file contains hidden or 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
| source "http://rubygems.org" | |
| gem "janky", "~>0.9" | |
| gem "pg" | |
| gem "thin" |