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
function bench() { | |
let samples = []; | |
let start = process.hrtime.bigint(); | |
for (let i = 0; i < 100_000_000; i++) { | |
let s = process.hrtime.bigint(); | |
let foo = JSON.parse('{ "a": 1, "b": 2, "c": 3, "d": 4 }'); | |
samples.push(process.hrtime.bigint() - s); |
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
def markdown(assigns) do | |
body = | |
case (assigns.value) do | |
nil -> assigns.fallback | |
_ -> anchors_with_targets(assigns.value) | |
end | |
~H""" | |
<div class={["markdown", @class]}> | |
<%= body %> |
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
#! /usr/bin/env node | |
var domain = require('domain'); | |
var Promise = require('bluebird'); | |
console.log('This is a demonstration of a bug in Bluebird when Domains are involved.'); | |
console.log('If a then() throws an exception, the domain does not exit() and remains on the stack.'); | |
function reportDomainDepth(state) { | |
console.log(state + ', current domain depth is ' + domain._stack.length); |