Containerized ephemeral heroku-like local environment
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
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| "sync" | |
| ) | |
| func timedPrint(number int64, group *sync.WaitGroup) { | |
| time.Sleep(time.Duration(number) * time.Millisecond) |
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
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
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
| [1, 2].map(function (x) { return x; }) // -> [1, 2] | |
| [1,, 2].map(function (x) { return x; }) // -> [1, undefined × 1, 2] | |
| [1, 2].map(function () { return 'constant'; }) // -> ["constant", "constant"] | |
| [1,, 2].map(function () { return 'constant'; }) // -> ["constant", undefined × 1, "constant"] |