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
[core] | |
excludesfile = ~/.gitignore_global | |
excludesfile = ~/.gitignore | |
# When paging to less: | |
# * -x2 Tabs appear as two spaces | |
# * -S Chop long lines | |
# * -F Don't require interaction if paging less than a full screen | |
# * -X No scren clearing | |
# * -R Raw, i.e. don't escape the control characters that produce colored output | |
pager = less -FXRS -x2 |
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
" RSpec mappings: | |
" <Leader>rs – run entire spec suite | |
" <Leader>rd – run all specs in the pwd | |
" <Leader>rf – run all specs in the current file | |
" <Leader>rl – run the line under the cursor | |
noremap <Leader>rs :call RunSpec('spec', '-fp')<CR> | |
noremap <Leader>rd :call RunSpec(expand('%:h'), '-fd')<CR> | |
noremap <Leader>rf :call RunSpec(expand('%'), '-fd')<CR> | |
noremap <Leader>rl :call RunSpec(expand('%'), '-fd -l ' . line('.'))<CR> |
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
# Lock down controller actions with CanCan based on request format. | |
class Ability | |
include CanCan::Ability | |
def initialize(user, format=nil) | |
user ||= User.new | |
can :index, Model if format == "application/json" | |
end | |
end |
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
#!/bin/bash | |
# This is an example of OAUTH2 authorization via GitHub and adding a new (optionally generated) SSH key to your account. | |
# If generated, the key is put in the default location with no password. Security is obviously relaxed for brevity's sake. Enjoy. | |
read -p "GitHub Username: " uname | |
read -s -p "GitHub Password: " passwd | |
if [[ "$uname" == "" || "$passwd" == "" ]]; then | |
echo -e "\n\nCan't set up your GitHub SSH keys without authorization. You're on your own now, champ." | |
exit 1 | |
fi |
NewerOlder