This guide is for 'linuxing-up' Windows as a development environment; it focuses on setting up [WSL], an Ubuntu Hyper-V virtual machine, [wsltty] (a nice terminal emulator) and various tweaks.
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 splitAt = (s, n) => [s.slice(0, n), s.slice(n + 1)]; |
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 reverse = xs => [...xs].reverse() | |
const times = (length, f) => Array.from({ | |
length | |
}, f) | |
const flat = xs => xs.reduce((a, b) => a.concat(b), []) | |
const sum = ns => ns.reduce((a, b) => a + b) | |
const findPositiveIndex = ns => ns.findIndex(n => n > 0) | |
const trimNegative = ns => ns.slice(findPositiveIndex(ns), ns.length - findPositiveIndex(reverse(ns))) |
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
#!/bin/bash | |
# | |
# Author: Peter Maloney | |
# License: GPLv2 | |
backed_up=false | |
now=$(date +%s) | |
file=/etc/ssh/sshd_config | |
support_applications=() | |
pubkeyonly=false |
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
/** | |
** ____ _ ___ ___ _ _ | |
** | _ \ | | | \/ | | | (_) | |
** | | \ |__ _ _ __| | __ | . . | ___ _ __ ___ | | __ __ _ _ | |
** | | | | _` | '__| |/ / | |\/| |/ _ \| '_ \ / _ \| |/ // _` | | | |
** | |_/ /(_| | | | < | | | | (_) | | | | (_) | <| (_| | | | |
** |____/\__,_|_| |_|\_\ \_| |_/\___/|_| |_|\___/|_|\_\\__,_|_| | |
** | |
** Quassel Theme | |
** |
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
class Deferred { | |
constructor() { | |
this.promise = new Promise((resolve, reject) => { | |
this.resolve = value => { | |
resolve(value); | |
return this.promise; | |
}; | |
this.reject = reason => { | |
reject(reason); | |
return this.promise; |
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
// CSS Color Names | |
// Compiled by @bobspace. | |
// | |
// A javascript array containing all of the color names listed in the CSS Spec. | |
// The full list can be found here: http://www.w3schools.com/cssref/css_colornames.asp | |
// Use it as you please, 'cuz you can't, like, own a color, man. | |
export default [ | |
`AliceBlue`, | |
`AntiqueWhite`, |
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
class JSONSet extends Set{ | |
constructor(values) { | |
super() | |
this.map = new Map() | |
if (values) { | |
[...values].forEach(value => void this.add(value)) | |
} | |
} | |
has(value) { | |
return this.map.has(JSON.stringify(value)) |
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 abortError = new Error(`Aborted`) | |
const promisifySignal = signal => | |
signal.aborted | |
? Promise.reject(abortError) | |
: new Promise( | |
(_, reject) => | |
void signal.addEventListener(`abort`, () => void reject(abortError), { once: true }), | |
) | |
const sleep = (delay, ...args) => new Promise(resolve => setTimeout(resolve, delay, ...args)) | |
const cancelableSleep = (delay, signal, ...args) => |
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 _new = (constructor) => (...args) => constructor.apply(Object.create(constructor.prototype), args) |