Skip to content

Instantly share code, notes, and snippets.

@mkornatz
mkornatz / datahub-nginx-proxy.conf
Last active February 2, 2022 16:57
DataHub nginx proxy configuration (supports websockets)
# This configuration can be used to create a reverse proxy for use with Figment's DataHub service
#
# This file can be included by placing it into /etc/nginx/sites-enabled/ (Debian based distros)
# or /etc/nginx/conf.d/ (Red Hat based distros)
server {
# The proxy will listen on port 80 (SSL is not enabled)
listen 80;
# Replace EXAMPLE with the DataHub service name
@munkacsitomi
munkacsitomi / promise-all-error-handling.js
Created March 1, 2020 15:47
Promise.all error handling
const pause = (data, time) => new Promise(resolve => setTimeout(() => resolve(data), time));
const pauseReject = (data, time) =>
new Promise((resolve, reject) =>
setTimeout(() => reject(new Error(`Something went wrong in the ${data} promise`)), time)
);
const parallelErrorHandlingWrong = () => {
const firstPromise = pause('first', 3000);
const secondPromise = pauseReject('second', 2000);
const thirdPromise = pause('third', 1000);