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
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
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 })
const { log, serve } = require('reserve')
log(serve({
port: 8005,
mappings: [{
match: /^\/(.*)/,
url: 'http://facetheforce.today/$1'
}]
}), process.argv.includes('--verbose'))
Uncaught ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor
TypeError: Class constructor A cannot be invoked without 'new'
const gpf = require("gpf-js");
class A {
constructor () {
this._a = "A";
}
}
const B = gpf.define({
$class: "B",
let caseSensitive = true
function getEntry (entryPath) {
if (!caseSensitive) {
entryPath = entryPath.toLowerCase()
}
if (entryPath === '/') {
return entries
}
return entryPath.split(path.sep).slice(1).reduce((folder, name) => {
{
"extend": "./mappings.json",
"port": 5000
}