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
async function exec(name, ...args) { | |
const res = await fetch(`/rpc/${name}`, { | |
method: "POST", | |
headers: { | |
"content-type": "application/json" | |
}, | |
body: JSON.stringify(args) | |
}); | |
const json = await res.json(); | |
return json; |
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
module.exports.mergeCoverageByUrl = function(coverage) { | |
const merged = {}; | |
for (const entry of coverage) { | |
if (!merged[entry.url]) { | |
merged[entry.url] = entry; | |
} | |
merged[entry.url].ranges.push(...entry.ranges); | |
} | |
Object.values(merged).forEach(entry => { | |
entry.range = convertToDisjointRanges(entry.ranges); |
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
type MIDIInputMap = Map<DOMString, MIDIInput>; // maplike | |
type MIDIOutputMap = Map<DOMString, MIDIOutput>; // maplike | |
type DOMString = string; | |
interface MIDIAccess extends EventTarget { | |
readonly inputs: MIDIInputMap; | |
readonly outputs: MIDIOutputMap; | |
onstatechange: (e: MIDIConnectionEvent) => void; | |
readonly sysexEnabled: boolean; | |
} |
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 fs = require("fs"); | |
const childProcess = require("child_process"); | |
childProcess.exec("./node_modules/.bin/elm-analyse", (e, out) => { | |
let file; | |
let all = {}; | |
for (let line of out.split("\n")) { | |
if (line.startsWith("-")) { | |
file = line.slice(2); | |
continue; |
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
# this original one uses values returned from 'brew info' | |
brew list --formula | xargs -n1 -P8 -I {} \ | |
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \ | |
sort -h -r -k2 - | column -t | |
# faster alternative using 'du' | |
du -sch $(brew --cellar)/*/* | sed "s|$(brew --cellar)/\([^/]*\)/.*|\1|" | sort -k1h |
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
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |