{{ message }}

Instantly share code, notes, and snippets.

# Tobias Baunbæk Christensenfreeall

Created Oct 29, 2020
View loop-time.js
 const testLength = Number(process.argv[2] || 10000000) console.log('Loop speed test') console.log(`Initiating array with \${testLength} items`) const arr = new Array(testLength).fill(1) time(loopSimple) time(loopForIn) time(loopForOf)
Last active Mar 6, 2020
Super naive way of testing out the Monty Hall problem
View monty-hall.js
 /* A quick stab at writing the Monty Hall problem, and testing out if it does indeed give a 1/3 chance if you don't change the doors, but a 2/3 chance if you do. https://en.wikipedia.org/wiki/Monty_Hall_problem Running this, unsurprisingly, gives something like: No change: 100000 runs. 33229 correct guesses. 33.23% correct Change: 100000 runs. 66631 correct guesses. 66.63% correct */
Created Aug 27, 2019
View test.js
 const a = require('a') const b = [] b.forEacH(foo => bar(foo))
Last active Jan 4, 2016
View db.js
 /* globals done */ var pg = require('pg'); var conString = 'postgres://pg_logvent:Bow3CuU7foVHbr@localhost/db_logvent'; module.exports = function(options) { 'use strict'; options = options || {};
Last active Jan 4, 2016
View db.js
 /* globals done */ var pg = require('pg'); var conString = 'postgres://pg_logvent:Bow3CuU7foVHbr@localhost/db_logvent'; module.exports = function(options) { 'use strict'; options = options || {};
Last active Jan 4, 2016
View db.js
 /* globals done */ var pg = require('pg'); var conString = 'postgres://pg_logvent:Bow3CuU7foVHbr@localhost/db_logvent'; module.exports = function(options) { 'use strict'; options = options || {};
Created Jan 27, 2014
View db.js
 /* globals done */ var pg = require('pg'); var conString = 'postgres://pg_logvent:Bow3CuU7foVHbr@localhost/db_logvent'; module.exports = function(options) { 'use strict'; options = options || {};
Last active Dec 14, 2015 — forked from mafintosh/auth.js
View auth.js
 // server.js var app = express(); var user = require('user'); var static = require('static'); app.route('/user/*', user); app.route('/s/*', static);
Created Dec 4, 2012
some test
View test.js
 og noget emre
Last active Aug 29, 2015
How to query the CVR database