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 | |
echo "echo Again." >> ~/test.sh | |
echo Hello. |
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
var dgram = require('dgram'); | |
var socket = dgram.createSocket('udp4'); | |
// looks like the send might not need to be in the bind callback | |
socket.bind(8001, '0.0.0.0', function() { | |
socket.send(new Buffer('HELO'), 0, 4, 8001, 'localhost'); | |
}); | |
socket.on('message', function ondata(data, rinfo) { |
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
/** | |
* @param {Object.<string, boolean>} data | |
* @return {number} | |
*/ | |
function hello(data) { | |
var q = 0; | |
if (data.a) { | |
if (data.b && data.c) { | |
q = 1 | |
} else if (data.d) { |
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
var scan = (function(window, document) { | |
/** | |
* Scans through all the pages and maps all the reviews. | |
* | |
* TODO: automatically switch to date-ordered reviews, and page backwards to | |
* beginning. | |
* | |
* @param {function(?Error, Object, Array)} callback The callback when all reviews have | |
* been found. | |
*/ |
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 |
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
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
#!/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
#!/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
#!/bin/bash | |
if [ "$#" -eq 0 ]; then | |
md5sum "$@" | |
exit 0 | |
fi | |
recursive=0 | |
exclude=0 | |
sum=0 |