This file contains hidden or 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 append(dest) { | |
for (var i = 1, n = arguments.length; i < n; i++) { | |
var src = arguments[i], offset = dest.length; | |
dest.length += src.length; | |
for (var j = 0, l = src.length; j < l; j++) { | |
dest[offset++] = src[j]; | |
} | |
} | |
return dest; | |
} |
This file contains hidden or 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
concurrent=1 algo=sha256 type=asc encoding=ascii len=2 api=legacy: 0.000098569 | |
concurrent=1 algo=sha256 type=asc encoding=ascii len=2 api=stream: 0.0000081394 | |
concurrent=1 algo=sha256 type=asc encoding=ascii len=2 api=digest: 0.000032721 | |
concurrent=1 algo=sha256 type=asc encoding=ascii len=1024 api=legacy: 0.030183 | |
concurrent=1 algo=sha256 type=asc encoding=ascii len=1024 api=stream: 0.0044764 | |
concurrent=1 algo=sha256 type=asc encoding=ascii len=1024 api=digest: 0.019793 | |
concurrent=1 algo=sha256 type=asc encoding=ascii len=102400 api=legacy: 1.5514 | |
concurrent=1 algo=sha256 type=asc encoding=ascii len=102400 api=stream: 0.36778 | |
concurrent=1 algo=sha256 type=asc encoding=ascii len=102400 api=digest: 1.2178 | |
concurrent=1 algo=sha256 type=asc encoding=ascii len=1048576 api=legacy: 2.0210 |
This file contains hidden or 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 | |
pushd . >> /dev/null | |
top="$(git rev-parse --show-toplevel 2>/dev/null)" | |
if [ "$top" != '' ]; then | |
cd "$(dirname "$top")" | |
fi | |
for dir in * | |
do | |
if [ -d "${dir}" ] && [ -d "${dir}/.git" ]; then | |
pushd . >> /dev/null |
This file contains hidden or 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
/tmp$ mkdir gittest | |
/tmp$ cd gittest | |
/tmp/gittest$ git init | |
/tmp/gittest$ echo test > test | |
/tmp/gittest$ git add test | |
/tmp/gittest$ git commit -m test | |
/tmp/gittest$ git diff-index --quiet HEAD | |
/tmp/gittest$ echo $? | |
0 | |
/tmp/gittest$ echo "another test" >> test |
This file contains hidden or 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 | |
if [ "$#" -eq 0 ]; then | |
md5sum "$@" | |
exit 0 | |
fi | |
recursive=0 | |
exclude=0 | |
sum=0 |
This file contains hidden or 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 | |
var crypto = require('crypto'); | |
var chars = parseInt(process.argv[2], 10) || 32; | |
var blockSize = 1024 * 1024; | |
function sync(count) { | |
console.log(crypto.randomBytes(Math.ceil(count / 2)).toString('hex').slice(0, count)); | |
} |
This file contains hidden or 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 | |
var fs = require('fs'); | |
var path = require('path'); | |
var hasOwn = Object.prototype.hasOwnProperty; | |
// seaches recursively upwards to find the package.json | |
function load(start, name) { | |
var exists, full; | |
do { |
This file contains hidden or 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* locate(low, high) { | |
var mid; | |
if (high === Infinity || high === undefined) { | |
mid = 1; | |
for (;;) { | |
if ((yield mid) > 0) { | |
mid <<= 1; | |
} else { | |
high = mid << 1; | |
break; |
This file contains hidden or 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\s*[^\(]*\(\s*([\$a-z][\$a-z0-9]*)\s*\)\s*\{\s*return\s+\1\s*;?\s*\} |
This file contains hidden or 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
script | |
VALUE="PONG" | |
echo "START" >> /var/log/stupid-test.log | |
if [ "$VALUE" == "PONG" ]; then | |
echo "GOOD PONG" >> /var/log/stupid-test.log | |
fi | |
if [ "$VALUE" != "PONG" ]; then | |
echo "BAD PONG" >> /var/log/stupid-test.log | |
fi | |
if [ "$VALUE" == "PING" ]; then |