This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// find().count() vs find().limit(1).count() vs count() vs collection.count() | |
// Purpose was to detect if collections is empty or not. (That's why limit(1) is fine too) | |
const { performance } = require('perf_hooks'); | |
const fs = require('fs'); | |
const mongoose = require('mongoose'); | |
require('dotenv').config(); | |
const billionUsers = mongoose.model('User', { | |
n: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on http://onais-m.blogspot.nl/2014/10/automatic-graph-layout-with-javascript.html | |
var jsp = jsPlumb.getInstance(); | |
// construct dagre graph from JsPlumb graph | |
/* global dagre */ | |
var g = new dagre.graphlib.Graph(); | |
g.setGraph({nodesep:30,ranksep:30,marginx:50,marginy:50}); | |
g.setDefaultEdgeLabel(function() { return {}; }); | |
$('.xnode').each( |
NewerOlder