Runs the test specified in https://research.swtch.com/glob
against node-glob which uses minimatch
Setup:
npm i glob
mkdir aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
chmod +x ./test.sh
(function() { | |
function range(start,stop) { | |
var result=[]; | |
for (var idx=start.charCodeAt(0),end=stop.charCodeAt(0); idx <=end; ++idx){ | |
result.push(String.fromCharCode(idx)); | |
} | |
return result; | |
}; |
Runs the test specified in https://research.swtch.com/glob
against node-glob which uses minimatch
Setup:
npm i glob
mkdir aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
chmod +x ./test.sh
lebab --replace lib --transform arrow --transform for-of --transform for-each --transform arg-rest --transform arg-spread --transform obj-method --transform multi-var --transform let --transform class --transform commonjs --transform template | |
prettier --single-quote --trailing-comma all --bracket-spacing --write "./{test,lib}/**/*.js" |
var images = []; | |
function getPhoto() { | |
var img = document.querySelector('.spotlight'); | |
console.log(images.length, img.src); | |
var hasImage = images.indexOf(img.src) !== -1 | |
if (!hasImage) { | |
images.push(img.src); | |
var currentSrc = img.src; | |
document.querySelector('.snowliftPager.next').click(); |
<html> | |
<script> | |
var m = require("minilog")("web"); | |
require("minilog").enable(); | |
m.error("some err"); | |
</script> | |
</html> |
find ./conf -type f -name "*.json" -print | xargs -L 1 node -e "var out = '', fs = require('fs'); var out = process.argv[process.argv.length - 1]; var j = JSON.parse(fs.readFileSync(out).toString()); fs.writeFileSync(out, JSON.stringify(traverse(j), null, 2)); function traverse(j) { if (Array.isArray(j)) { return j.map(traverse); } if (typeof j !== 'object' || j === null) { return j; } var r = {}; Object.keys(j).sort().forEach(function(k) { r[k] = traverse(j[k]); }); return r; }" |
git ls-tree -r --name-only HEAD | while read filename; do | |
echo "$(git log -1 --format="%at | %h | %an | %ad |" -- $filename) $filename" | |
done |
for i in `service --status-all |& grep -Po "(zookeeper|hadoop).*"`; do sudo service $i restart; done |
// evil global | |
// very helping | |
// such expressive | |
// wow | |
Number.prototype.days = function() { | |
var i = this; | |
return { | |
from_now: function() { | |
var d = new Date(); |
document.querySelectorAll('video')[0].playbackRate = 2 |