Tiny Node.js module to securely hash and compare passwords using pbkdf2 with per password random salt.
To hash a password:
var password = require('./password');
const crypto = require('crypto'); | |
let hash; | |
let index = 0; | |
function check() { | |
const data = hash.read().toString('hex'); | |
hash.removeListener('readable', check); |
#!/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; |
#!/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 ;; |
#!/usr/bin/env bash | |
spinner_abort() { | |
[ -n "$SPINNER_PID" ] && kill $SPINNER_PID | |
echo -e '\033[?25h' | |
exit 0 | |
} | |
spinner_loop() { | |
while true; do |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
import sys | |
import time | |
cursor = '\033[1D' | |
frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'] | |
amount = len(frames) | |
hide = '\033[?25l' |
#!/usr/bin/env bash | |
ACTION= | |
OPTION_A='undefined' | |
OPTION_B='undefined' | |
OPTIONS=("$@") | |
LENGTH=${#OPTIONS[@]} | |
main() { | |
echo " Action: $ACTION" |
# usage
./color <r> <g> <b>
{ | |
"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'" | |
} | |
} |