# 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
#!/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; |
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
const crypto = require('crypto'); | |
let hash; | |
let index = 0; | |
function check() { | |
const data = hash.read().toString('hex'); | |
hash.removeListener('readable', check); |
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 | |
main() { | |
local commit_message_file=$1 | |
local branch_name=$(__git_ps1 '%s' | cut -d '|' -f 1) | |
local commit_message=$(cat "$commit_message_file") | |
# do nothing if the commit_message already begins with the branch_name | |
if [[ "$commit_message" == "$branch_name"* ]]; then |
OlderNewer