Skip to content

Instantly share code, notes, and snippets.

View ylv-io's full-sized avatar
🤑
Building Internet Money

Igor Yalovoy ylv-io

🤑
Building Internet Money
View GitHub Profile
// in order to properly stub and mock libs which export function by default
// more https://github.com/sinonjs/sinon/issues/562
export const cache = {};
export default function(lib) {
const module = require(lib);
if (!cache.hasOwnProperty(lib)) cache[lib] = module;
return () => cache[lib].apply(this, args);
}
const oraFactory = function (opts) {
return new Ora(opts);
};
module.exports = oraFactory;

Keybase proof

I hereby claim:

  • I am ylv-io on github.
  • I am ylvio (https://keybase.io/ylvio) on keybase.
  • I have a public key ASDCGNJT_O1V_IQ-hLEg9lkPGoy__lPjtTbYvkB3mR8xBAo

To claim this, I am signing this object:

console.log(1 < 2 < 2);
console.log(3 > 2 > 1);
for (var i = 0; i < 5; i++) {
setTimeout(function() { console.log(i); }, i * 1000 );
}
for (let i = 0; i < 5; i++) {
setTimeout(function() { console.log(i); }, i * 1000 );
}
const a = {},
b = {c:'b'},
c = {b:'c'};
a[b] = 111;
a[c] = 333;
console.log(a[b]);
console.log(0.1 + 0.2);
console.log(0.1 + 0.2 === 0.3);
console.log(9007199254740993 === 9007199254740992);
function foo1() {
return {
bar: 'bar',
};
}
function foo2() {
return
{
'bar';
(function(){
var a = b = 3;
})();
console.log(typeof a);
console.log(typeof b);
var x = 5;
(function () {
var x;
console.log(x);
x = 10;
console.log(x);
})();