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 | |
DIR=~/npm | |
if [[ ! -e $DIR ]]; then | |
mkdir $DIR | |
elif [[ ! -d $DIR ]]; then | |
echo "$DIR exists but is not a directory" 1>&2 | |
exit 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
#!/bin/bash | |
PIDFILE="nodemon.pid" | |
SERVER_PATH="server/index.js" | |
CLIENT_TASK="gulp serve" | |
if [ ! -f $PIDFILE ]; then | |
nohup nodemon $SERVER_PATH >/dev/null 2>&1 & | |
PID=$! | |
echo $PID > $PIDFILE |
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
(function() { | |
var url = 'https://www.random.org/passwords/?num=1&len=$1&format=plain&rnd=new', xhr = new XMLHttpRequest(), len, req, output; | |
len = window.prompt('How many characters?', 15); | |
url = url.replace('$1', len); | |
xhr.onload = function() { prompt('Here\'s your password', this.responseText); }; | |
xhr.open('get', url, true); | |
xhr.send(); | |
}()); |
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 | |
# place this in your .bash_aliases or similar | |
git_current_branch() { | |
git rev-parse --abbrev-ref HEAD | |
} | |
git_push_set_upstream() { | |
branch=`git_current_branch` | |
cmd="git push --set-upstream origin $branch" |
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
// see: http://jsbin.com/gipiyi/1/edit?js,output | |
// App code: | |
// ========= | |
var app = angular.module('app', []); | |
app.factory('HodorFactory', function($q) { | |
return { | |
isHodor: function() { | |
return $q(function(resolve) { |
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
gulp.task('shell-scss-lint', function() { | |
gulp.src('') | |
.pipe($.shell([ | |
'scss-lint -c src/config/scss-lint.config.yml src/app/common/styles/ > scss-report.txt' | |
])) | |
// swallow errors | |
.on('error', function() { | |
this.emit('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
SELECT t1.TABLE_NAME, t1.TABLE_ROWS, t2.TABLE_ROWS | |
FROM INFORMATION_SCHEMA.TABLES t1, INFORMATION_SCHEMA.TABLES t2 | |
WHERE t1.TABLE_NAME = t2.TABLE_NAME | |
AND t1.TABLE_SCHEMA = 'table1' | |
AND t2.TABLE_SCHEMA = 'table2' |
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 | |
mkdir -p ~/.aws | |
echo -e "[default]\naws_access_key_id=$AWS_ACCESS_KEY_ID\naws_secret_access_key=$AWS_SECRET_ACCESS_KEY" > ~/.aws/credentials |
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 | |
# USAGE: | |
# ./ec2ssh.sh <tag:name> <instance_num> [<remote_command>] | |
if [ $# -lt 2 ] | |
then | |
echo "Usage: `basename $0` <tag:name> <instance_num>" | |
exit 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
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
OlderNewer