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
#!/bin/sh | |
# Run the RSPec githook. | |
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then | |
# First try to load from a user install | |
source "$HOME/.rvm/scripts/rvm" | |
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then |
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
#!/bin/sh | |
FILES='(js|css|rb)' | |
FORBIDDEN='(binding.pry|console.log|debugger|byebug|\!important)' | |
GREP_COLOR='4;5;37;41' | |
if [[ $(git diff --cached --name-only | grep -E $FILES) ]]; then | |
git diff --cached --name-only | grep -E $FILES | \ | |
xargs grep --color --with-filename -n -E $FORBIDDEN && \ | |
echo "Looks like you are trying to commit something you shouldn't. Please fix your diff, or run 'git commit --no-verify' to skip this check, if you must." && \ | |
exit 1 |
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
(function($) { | |
// Make jQuery's :contains case insensitive (like HTML5 datalist) | |
// Changed the name to prevent overriding original functionality | |
$.expr[':'].RD_contains = function(a, i, m) { | |
return $(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0; | |
}; | |
$.fn.relevantDropdown = function(options) { |
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
def pig_latin(s) | |
vowels = %w(a e i o u) | |
words = s.split(' ') | |
@new_sentence = String.new | |
words.each_with_index do |w, i| | |
if vowels.include? w[0] | |
word = w + 'way' | |
word = i == (words.count - 1) ? word : word + ' ' |