# usage
./color <r> <g> <b>
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 check_for_virtual_env { | |
[ -d .git ] || git rev-parse --git-dir &> /dev/null | |
if [ $? == 0 ]; then | |
local ENV_NAME=`basename \`pwd\`` | |
if [ "${VIRTUAL_ENV##*/}" != $ENV_NAME ] && [ -e $WORKON_HOME/$ENV_NAME/bin/activate ]; then | |
workon $ENV_NAME && export CD_VIRTUAL_ENV=$ENV_NAME | |
fi | |
elif [ $CD_VIRTUAL_ENV ]; then |
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
{ | |
"scripts": { | |
"scripts": "node_modules/.bin/coffee scripts/*.coffee -o build", | |
"styles": "node_modules/.bin/node-sass styles/*.scss -o build", | |
"watch": "node_modules/.bin/vigilia 'scripts/**/*.coffee':'npm run scripts' 'styles/**/*.scss':'npm run styles'" | |
} | |
} |
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 bash | |
ACTION= | |
OPTION_A='undefined' | |
OPTION_B='undefined' | |
OPTIONS=("$@") | |
LENGTH=${#OPTIONS[@]} | |
main() { | |
echo " Action: $ACTION" |
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 python | |
# coding: utf-8 | |
import sys | |
import time | |
cursor = '\033[1D' | |
frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'] | |
amount = len(frames) | |
hide = '\033[?25l' |
Simple tool to generate the integrity attribute for subresource integrity.
Let's say you want to use Backbone from this CDN:
https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.3/backbone-min.js
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 bash | |
spinner_abort() { | |
[ -n "$SPINNER_PID" ] && kill $SPINNER_PID | |
echo -e '\033[?25h' | |
exit 0 | |
} | |
spinner_loop() { | |
while true; do |
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 bash | |
NAME=${NAME:-unknown} | |
main() { | |
while [ "$#" != 0 ]; do | |
case "$1" in | |
-h|--help) usage ;; | |
-n|--name) shift; set_name "$1" ;; | |
*) work $1; 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
#!/usr/bin/env node --harmony | |
const output = function(...data) { | |
process.stdout.write(data.join('')); | |
}; | |
const main = function(hour, minute) { | |
hour = +hour; | |
minute = (minute / 60) || 0; |
OlderNewer