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
console.log( | |
'\n\n\n> **Table of contents**\n> \n' + | |
Array.from(document.querySelectorAll('h1 > a, h2 > a, h3 > a')).map((a) => ( | |
{'H1':'> * ','H2':'> * ','H3':'> - '}[a.parentNode.tagName] + | |
`[${a.parentNode.innerText.trim()}](${a.hash})` | |
)).join('\n') + | |
'\n\n\n' | |
); |
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
const spawn = require('child_process').spawn; | |
async function runExternalProcessAsync({ procExecutable, procArgs, procStdinString }) { | |
const proc = await new Promise((resolve) => { | |
resolve(spawn(procExecutable, procArgs)); | |
}); | |
try { | |
return await new Promise((resolve, reject) => { | |
const procStdoutParts = []; | |
const procStderrParts = []; |
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
/* eslint-disable func-names, prefer-arrow-callback */ | |
function isTypeScriptFilePath(filePath) { | |
return /\.tsx?$/.test(filePath); | |
} | |
function isTypeScriptCode(text) { | |
return ( | |
/^\s*((declare\s+module)|(interface))\s+/m.test(text) | |
); |
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
const EventEmitter = require('events'); | |
function gracefulSigint({ forceAttempts } = {}) { | |
let state = { | |
isEnabled: false, | |
isTerminating: false, | |
isTerminatingForce: forceAttempts >= 0 ? forceAttempts : 5, | |
}; | |
let emitter = new EventEmitter(); | |
let sigintHandler = () => { |
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
const progressDefaultColor = typeof chalk !== 'undefined' ? chalk.magenta : (x) => x; | |
const progressErrorColor = typeof chalk !== 'undefined' ? chalk.red : (x) => x; | |
function formatProgress(startTime, queuedCount, finishedCount, errorsCount) { | |
const progressPercent = queuedCount > 0 ? (100 * finishedCount) / queuedCount : 100; | |
const errorsPercent = queuedCount > 0 ? (100 * errorsCount) / queuedCount : 0; | |
const elapsedTimeSeconds = (Date.now() - startTime) / 1000; | |
const itemsPerSecond = elapsedTimeSeconds > 0 ? finishedCount / elapsedTimeSeconds : 0; | |
const estimatedTimeSeconds = itemsPerSecond > 0 ? Math.max(0, (queuedCount - finishedCount) / itemsPerSecond) : 0; | |
return ( | |
progressDefaultColor( |
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
{ | |
"arrowParens": "always", | |
"singleQuote": true, | |
"trailingComma": "all", | |
"bracketSpacing": true, | |
"semi": true, | |
"useTabs": false, | |
"jsxBracketSameLine": false, | |
"printWidth": 120 | |
} |
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
.discussion-item-header[id^=ref-] .discussion-item-icon { | |
background-color: #6db2ff; | |
color: #ffffff; | |
} | |
.discussion-item-header[id^=ref-]::before { | |
content: ''; | |
position: absolute; | |
display: block; | |
z-index: -1; |
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
.hx .ii, | |
div.G3.G2.afm { | |
border-top: 1px solid rgba(0, 0, 0, 0.1); | |
} | |
div.T-I.J-J5-Ji.T-I-KE.L3 { | |
height: 30px; | |
margin: 0; | |
padding: 0 16px; | |
text-align: center; | |
justify-content: center; |
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
// Adapt tree view and editor font size for large monitors (like the 27" ones). | |
@media (min-width: 1800px) { | |
// Root font size | |
body { | |
font-size: 18px; | |
} | |
// Editor font size is specified separately | |
atom-workspace { | |
// NOTE: This overrides the built-in editor text zoom feature (Cmd + / Cmd - / Cmd 0). |
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 | |
set -eu | |
REPO_PATH=$1 | |
SHA=$2 | |
if [[ ! -d "${REPO_PATH}" ]]; then | |
exit -1 | |
fi |
NewerOlder