Skip to content

Instantly share code, notes, and snippets.

View ArnaudBuchholz's full-sized avatar
🏠
Working from home

Arnaud Buchholz ArnaudBuchholz

🏠
Working from home
View GitHub Profile
TypeError: Class constructor A cannot be invoked without 'new'
Uncaught ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor
const { log, serve } = require('reserve')
log(serve({
port: 8005,
mappings: [{
match: /^\/(.*)/,
url: 'http://facetheforce.today/$1'
}]
}), process.argv.includes('--verbose'))
const { createWriteStream, mkdir } = require('fs')
const { dirname, join } = require('path')
const { capture, log, serve } = require('..')
const mkdirAsync = require('util').promisify(mkdir)
const cacheBasePath = join(__dirname, 'cache')
// Should wait for completion
mkdirAsync(cacheBasePath, { recursive: true })
const { createWriteStream, mkdir } = require('fs')
const { dirname, join } = require('path')
const { capture, log, serve } = require('..')
const mkdirAsync = require('util').promisify(mkdir)
const cacheBasePath = join(__dirname, 'cache')
// Should wait for completion
mkdirAsync(cacheBasePath, { recursive: true })
const { createWriteStream, mkdir } = require('fs')
const { dirname, join } = require('path')
const { capture, log, serve } = require('..')
const mkdirAsync = require('util').promisify(mkdir)
const cacheBasePath = join(__dirname, 'cache')
// Should wait for completion
mkdirAsync(cacheBasePath, { recursive: true })
function trunkSize (n) {
return Math.floor(n / 3)
}
function drawTopOfTree (chars, n) {
const width = (n - 1) * 2 + 1
let currentPos = 0
return new Array(n).fill(0).map((_, index) => {
const placeholders = new Array(index + 1).fill('x').join(' ')
const spaceLeft = width - placeholders.length