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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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/sh | |
# this file should be marked as executable and placed on .git/hooks/ | |
BRANCH_NAME=$(git branch 2>/dev/null | grep -e ^* | tr -d ' *') | |
if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ] && [ "$BRANCH_NAME" != "(nobranch)" ]; then | |
echo "#$BRANCH_NAME $(cat $1)" > $1 | |
fi |
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
# ~/.osx — http://mths.be/osx | |
# root check | |
if [[ $EUID -ne 0 ]]; then | |
echo "################################"; | |
echo "## YOU ARE NOT RUNNING AS ROOT #"; | |
echo "################################"; | |
echo "#"; | |
echo "# USAGE: sudo $0"; | |
exit; |
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
namespace :jshint do | |
task :require do | |
sh "which jshint" do |ok, res| | |
fail 'Cannot find jshint on $PATH' unless ok | |
end | |
end | |
task :check => 'jshint:require' do | |
project_root = File.expand_path('../../', File.dirname(__FILE__)) | |
config_file = File.join(project_root, 'config', 'jshint.json') |
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
#!/usr/bin/env ruby -w | |
# brew-services(1) - Easily start and stop formulas via launchctl | |
# =============================================================== | |
# | |
# ## SYNOPSIS | |
# | |
# [<sudo>] `brew services` `list`<br> | |
# [<sudo>] `brew services` `restart` <formula><br> | |
# [<sudo>] `brew services` `start` <formula> [<plist>]<br> |