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
(typeof tests!=='object')&&(tests={});var | |
it=((it=function(k,v){it.d.push(k);it.t[it.d]=1;it.b.forEach(it.c);try{v()}catch(e){it.t[it.d]=0;setTimeout&&setTimeout(function(){throw e;})}it.a.forEach(it.c);it.d.pop()}), | |
it.a=[],it.b=[],it.c=function(x){x()},it.d=[],it.d.toString=function(){return this.join(' ')}, | |
it.t=tests,it.x=function(v){this.v=v},it.xp=it.x.prototype,it.xp.toBe=function(x){(this.v!==x)&&it._()}, | |
it.xp.toNotBe=function(x){(this.v===x)&&it._()},it.xp.toEql=function(x){(this.v!=x)&&it._()}, | |
it.xp.toNotEql=function(x){(this.v==x)&&it._()},it.xp.toBeOk=function(){!this.v&&it._()}, | |
it.xp.toNotBeOk=function(){this.v&&it._()},it),describe=function(k,v){it.d.push(k);v();it.d.pop()}, | |
expect=function(v){return new it.x(v)},beforeEach=it.b.push.bind(it.b),afterEach=it.a.push.bind(it.a); |
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 | |
_ = require('lodash'), | |
Benchmark = require('benchmark'), | |
suite = new Benchmark.Suite, | |
result = [], | |
seedSize = 10000, | |
seedData = Array(seedSize).fill().map(() => String(Math.round(Math.random() * seedSize))); | |
suite |
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
#!/bin/bash | |
tail -n0 -F "$1" | while read LINE; do | |
(echo "$LINE" | grep -e "$3") && curl -X POST --silent --data-urlencode \ | |
"payload={\"text\": \"$(echo $LINE | sed "s/\"/'/g")\"}" "$2"; | |
done |
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 | |
const | |
resolve = require('path').resolve, | |
loadJSON = function (file) { | |
return JSON.parse(require('fs').readFileSync(file).toString()); | |
}, | |
dependencySources = ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies', |
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 | |
/** | |
* Read a package.json file and then replace all dependencies and | |
* optionally dev dependencies into bundled dependencies. | |
*/ | |
var p = '', | |
writeFile = require('fs').writeFile, | |
resolve = require('path').resolve; |
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
/** | |
* Tests whether a path is a directory or possibly a file reference. | |
* | |
* @param {string} path | |
* @returns {boolean} | |
*/ | |
isUnixDirectory: function (path) { | |
return (/(^\.+$)|(\/$)/).test(path); | |
} |
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
var Graph = function () { | |
this.vertices = {}; | |
this.edges = []; | |
this.length = 0; | |
}; | |
Graph.Vertex = function (name, value) { | |
this.name = name; | |
this.edges = []; | |
this.value = value; |
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
echo -n "ACT Data Usage Info:"; | |
# Fetch Url, locate line with quota and remove HTML tags | |
curl --silent --url "http://portal.acttv.in/index.php/mypackage" | grep 'Quota' | sed -e 's/<[^>]*>//g' -e 's/\ /\ /g'; |
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
/** | |
* Bootstrap module for Slack notification on server startup | |
* | |
* Expects: config/slack.js | |
* - enabled | |
* - organisation | |
* - key | |
* - messages.spawn | |
* - payload | |
*/ |