Start a container in detached mode:
docker run -dit --name deb -e "LANG=C.UTF-8" -w "/root" debian:latest bash
Connect to it and do initial setup:
const wrapPromise = fn => (...args) => | |
new Promise(resolve => setTimeout( | |
() => resolve(fn(...args)), | |
Math.floor(Math.random() * 1500) + 250) | |
) | |
const upper = wrapPromise(str => str.toUpperCase()) | |
const underline = str => `__${str}__` | |
const exclamate = wrapPromise(str => str + '!') | |
// Util: Create promise chain |
{ | |
// Tight coupling from A to B => A needs B to be defined, callable and adhere to an interface | |
// No coupling from B to A => B does not need A in any way (pure fn) | |
function a() { | |
b() | |
} | |
function b() {} | |
} | |
{ |
const { curryN, curry } = require('./curry') // https://gist.github.com/branneman/4ffb7ec3fc4a2091849ba5d56742960c | |
// Typechecks | |
const isUndef = x => typeof x === 'undefined' | |
const isNull = x => x === null | |
const isBool = x => typeof x === 'boolean' | |
const isNum = x => typeof x === 'number' && isFinite(x) | |
const isInt = x => typeof x === 'number' && isFinite(x) && Math.floor(x) === x | |
const isStr = x => typeof x === 'string' | |
const isArr = x => Array.isArray(x) |
'use strict' | |
const curryN = (() => { | |
const isPlaceholder = x => x['@@functional/placeholder'] === true | |
const filterPlaceholders = xs => xs.filter(x => isPlaceholder(x)) | |
const filterValues = xs => xs.filter(x => !isPlaceholder(x)) | |
return (arity, fn, accIn = []) => (...args) => { | |
const accOut = accIn.slice() |
module.exports = factory | |
function factory() { | |
const exports = { | |
isDef, | |
isUndef, | |
isNull, | |
isBool, | |
isNum, | |
isInt, |
/** | |
* Turing Machine Interpreter | |
* | |
* Features: | |
* - Infinite tape, both ways | |
* - Uses JS values, anything that matches ==, is a valid symbol | |
* | |
* Definition: | |
* - States (Q): { integer, halt } | |
* - Input symbols read/write (Σ): any integer or string |
A Hogget is a sheep between one and two years of age. Inspired by Ramda, we also like sheep.
/** | |
* This function polls the component's props for Apollo to set `props.data.loading` to `false` | |
* @example | |
* await waitDuringLoadingState(testRenderer, TodoContainer) | |
* @see {@link https://reactjs.org/docs/test-renderer.html} | |
* @param {TestRenderer} testRenderer | |
* @param {React.Component} testComponent | |
* @returns {Promise} | |
*/ | |
export function waitDuringLoadingState(testRenderer, testComponent) { |
#!/usr/bin/env node | |
const fetch = require('node-fetch') | |
const ip = require('ip') | |
const os = require('os') | |
const env = require('./.env.json') | |
const endpoint = 'https://dns.api.gandi.net/api/v5/' | |
const newip = `${ip.address()}` | |
const domain = env.domain |