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/bash | |
CURRENT=`pwd` | |
echo -n "Enter directory to scaffold into... Use blank for $CURRENT " | |
read DIRECTORY | |
if [ -z $DIRECTORY ] && [ "${DIRECTORY+xxx}" = "xxx" ] | |
then | |
DIRECTORY=$CURRENT | |
fi |
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
// My current grunt.js file, includes examples for compiling less, | |
// handlebars templates, file watching, etc | |
// | |
// My most used task is the "watch-serve" task for linting/testing | |
// my files as I work, has been amazingly helpful | |
// | |
// This is a custom modification of @tbranyen's fantastic | |
// boilerplate-handlebars-layoutmanager project gruntfile | |
// | |
// NOTE: for this to work you need to install the below npm tasks |
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
Started POST "/api/users" for 127.0.0.1 at 2013-03-18 12:58:37 +0000 | |
Processing by Api::UsersController#create as JSON | |
Parameters: {"avatar_url"=>"/assets/placeholder-160x160.png", "email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "user"=>{"avatar_url"=>"/assets/placeholder-160x160.png", "email"=>"[email protected]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}} | |
WARNING: Can't verify CSRF token authenticity | |
[23509a-backend-cli] calling get, locales? | |
[23509a-backend-cli] call succeeded | |
[8575c9-backend-cli] calling post, users | |
[8575c9-backend-cli] error 500 Internal Server Error: RuntimeError at /users | |
====================== |
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
do shell script "kextunload /System/Library/Extensions/AppleHDA.kext && sleep 5 && kextload /System/Library/Extensions/AppleHDA.kext;" with administrator privileges |
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 | |
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then | |
echo "This is a pull request. No deployment will be done." | |
exit 0 | |
fi | |
if [[ "$TRAVIS_BRANCH" != "master" ]]; then | |
echo "Testing on a branch other than master. No deployment will be done." | |
exit 0 | |
fi |
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
require 'blanket' | |
github = Blanket.wrap("https://api.github.com") | |
# Get some user's info | |
user = github.users('inf0rmer').get | |
user.login | |
# => "inf0rmer" | |
# Get a user's repos |
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 method_missing(method, *args, &block) | |
Wrapper.new uri_from_parts([method, args.first]), { | |
headers: @headers, | |
extension: @extension | |
} | |
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
def add_action(action) | |
define_method(action) do |id=nil, options={}| | |
request(action, id, options) | |
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_action :get | |
add_action :post | |
add_action :put | |
add_action :patch | |
add_action :delete |
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
STATUSES = { | |
# ... | |
400 => 'Bad Request', | |
401 => 'Unauthorized', | |
402 => 'Payment Required', | |
403 => 'Forbidden', | |
404 => 'Resource Not Found', | |
405 => 'Method Not Allowed', | |
406 => 'Not Acceptable', | |
407 => 'Proxy Authentication Required', |
OlderNewer