Skip to content

Instantly share code, notes, and snippets.

View onosendi's full-sized avatar

Daniel Lindegren onosendi

View GitHub Profile
function browser_routes({
app,
auth_config,
app_type,
store,
options,
middleware,
}) {
app.post(options.auth_url, middleware, (req, res) => {
res.send('foo');
JWT_SECRET=dev secret
JWT_SECRET=super secret foo
DB_PASS=best db pass
SOME_VAR=
SOME_OTHER_VAR=
const start = performance.now();
Array.from({ length: 10000000 }, () => undefined);
const end = performance.now();
console.log({ performance: end - start });
'use strict';
const path = require('path');
const cwd = path.resolve(__dirname);
const ecosystem_config = {
apps: [
{
name: 'foo app',
const fn = (x) => new Promise((resolve, reject) => {
if (x === 0) {
reject(new Error('Error: equals 0'));
} else {
resolve(`Resolved: ${x}`);
}
});
const ps = [
fn(1),
function connect(address) {
return new Promise((resolve, reject) => {
const server = new WebSocket(address);
server.onopen = () => {
resolve(server);
};
server.onerror = (e) => {
reject(e);
};
});
const errors = [];
const ress = [];
const fn = (x) => new Promise((resolve) => {
if (x === 0) {
errors.push('Equals 0');
// reject(new Error('Error: equals 0'));
} else {
// resolve(`Resolved: ${x}`);
ress.push(`Equals ${x}`);
const foo = 0;
const a = {};
const b = {
...a,
...(foo === 0 ? { a: 'a' } : { b: 'b' }),
};