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
git ls-tree -r --name-only HEAD | while read filename; do | |
echo "$(git log -1 --format="%at | %h | %an | %ad |" -- $filename) $filename" | |
done |
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(); |
(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" |
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 |
#!/usr/bin/env node | |
/* | |
Installation: npm install linewise | |
Usage: | |
cat urls.json | node extract.js > urls.txt | |
Assuming urls.json contains lines with zero or more urls per line, this will | |
extract all the urls and produce a file with one url per line. |
// Needs to be run in the context of an extension with the "tabs" permission. | |
chrome.tabs.query({}, function(tabs) { | |
var byWindow = {}; | |
tabs.forEach(function(t) { | |
if(!byWindow[t.windowId]) { | |
byWindow[t.windowId] = [] | |
} | |
byWindow[t.windowId].push(t.url); | |
console.log(JSON.stringify(byWindow, null, 2)); |