Skip to content

Instantly share code, notes, and snippets.

View haydnba's full-sized avatar
++

Haydn Appleby haydnba

++
View GitHub Profile
import * as net from 'net';
import * as rl from 'readline';
import assert from 'assert/strict';
const [ COMMAND, PORT, HOST ] = process.argv.splice(2);
try {
assert.strictEqual(
['open', 'host'].includes(COMMAND),
true,
@haydnba
haydnba / alons-test
Last active May 11, 2021 12:23
Alon's tech test
Please write a data structure which has the following method:
1. setValue (index, value) - set the structure at `index` to `value`
2. getValue (index) - get the value of the data structure at `index`
3. setAll (value) - set all indices in the data structure to `value`
please implement all method in O(1) runtime.
Expected behaviour:
#
# NPM
#
# List globally installed dependencies without full tree
npm list -g --depth=0
# Install package under an alias (cli / package)
npm i foo@npm:bar
"foo": "npm:bar@^1.2.3"