Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
docker exec -it $1 /bin/bash
package main
import (
"math/rand"
"runtime"
"fmt"
)
const TEST_COUNT = 100000000
// Use *repeat* instead of *setInterval*
function repeat(fn, interval) {
fn()
setTimeout(function () {
repeat(fn, interval)
}, interval)
}
/* Mimics the way Haskell function works */
function cascade(fn, n) {
return (function helper(args) {
return function () {
args = args.concat(Array.prototype.slice.call(arguments))
return (args.length >= n) ? fn.apply(null, args) : helper(args)
}
}([]))
}