Skip to content

Instantly share code, notes, and snippets.

View jonbern's full-sized avatar

Jon K. Bernhardsen jonbern

View GitHub Profile
@jonbern
jonbern / ensureMongoDB.js
Last active October 25, 2018 08:42
MongoDB replicaset for tests
'use strict';
const fs = require('fs');
const execSync = require('child_process').execSync;
const path = require('path');
module.exports = version => {
const isWindows = process.platform === 'win32';
const mongoPath = path.resolve(__dirname, `../../data/${version}`);
const mongod = `${mongoPath}/mongod${isWindows ? '.exe' : ''}`;

Hubii » Front-end Engineer Exercise

Challenge

For this exercise we want you to create a simple React app that visualises the price history of ETH/USD and BTC/USD.

It should render the data in a readable, usable manner, and it should display the price history of one currency pair at the time. In addition it needs to be possible to choose which currency pair to show via the UI.

To get access to cryptocurrency price history you can register for a free plan at coinapi.io.

@jonbern
jonbern / promise-wait-for.js
Last active July 28, 2017 19:46
Alternative to Promise.all which will be resolved even when one or more promises are rejected.
function promiseOK() {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, 100);
});
}
function promiseFail() {
return new Promise((resolve, reject) => {