/etc
βββ nginx
β βββ sites-enabled
β β βββ domain.tld.port.conf # template attached
β βββ ssl
β βββ .conf # file attached as `ssl.conf`
β βββ dhparam.pem # generated
π
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
class FoldBreak <T> { | |
constructor(public value: T) {}; | |
}; | |
const foldBreak = <T>(value: T) => new FoldBreak(value); | |
export const fold = Object.assign(<X, Acc>( | |
reducer: (acc: Acc, x: X) => Acc | FoldBreak<Acc>, | |
init: Acc, | |
xs: X[], |
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 compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args))); | |
const listeners = {}; | |
const on = (ev, ...handlers) => { | |
if (!listeners[ev]) listeners[ev] = []; | |
listeners[ev].push(compose(...handlers)(x => x)); | |
}; | |
const emit = (ev, ctx) => { |
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/env node | |
const child = require("child_process"); | |
const readline = require("readline"); | |
const { promisify } = require("util"); | |
const getLines = () => | |
String( | |
child.execSync("neofetch --config ~/.mkr/config/neofetch.conf --off"), | |
) |
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 state = { | |
watch: false, | |
range: { | |
src: { | |
start: 0, | |
end: 0 | |
}, | |
dest: { | |
start: 0, | |
end: 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
"use strict"; | |
const htmlparser = window.htmlparser2; | |
const html2hyperscript = (input, stream) => { | |
const elements = new Set(); | |
let indentLevel = 0; | |
let attrOpen = false; | |
let textWritten = false; | |
let justClosed = false; | |
let size = 0; |
- Create all attached files below as-is. Directory structure:
etc
βββ nginx
β βββ sites-enabled
β β βββ domain.tld.port.conf (several)
β βββ ssl
β βββ .conf # file attached as ssl.conf
β βββ well-known.conf # file attached
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 betterArray = xs => new Proxy(xs, { | |
get (xs, key) { | |
if (xs[key] || !xs.length) return xs[key]; | |
const idx = Number(key); | |
if (!idx || idx > 0) return xs[key]; | |
return xs[xs.length + idx]; | |
}, | |
}); | |
const arr = betterArray([ 1, 2, 3, 4, 5 ]); |
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
@-moz-document domain("developer.mozilla.org") { | |
main { | |
background: #000; | |
} | |
html { | |
color: #fff; | |
} | |
.titlebar-container { |
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
function* map(f, iter) { | |
for (const i of iter) { | |
yield f(i); | |
} | |
} | |
function* filter(f, iter) { | |
for (const i of iter) { | |
if (f(i)) yield i; | |
} |