This file contains 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
const _ = require('lodash'); | |
const t = require('transducers.js'); | |
const arrayofRandoms = randomCeil => length => | |
Array.from({length: length}, (v, i) => | |
Math.floor(Math.random() * randomCeil)); | |
const arrOfMillion = arrayofRandoms(100)(1e6); | |
const tripleIt = (el) => el * 3; |
This file contains 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
var x = 1; | |
console.log("whatever") |
This file contains 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
h1,h2{padding-bottom:.3em;border-bottom:1px solid #eee}*{font-size:16px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";line-height:1.5;word-wrap:break-word}blockquote,dl,ol,p,pre,table,ul{margin-top:0;margin-bottom:16px}h1,h2,h3,h4,h5,h6{margin-top:24px;margin-bottom:16px;line-height:1.25}h1{font-size:2em}h2{font-size:1.5em}h3{font-size:1.25em}h4{font-size:1em}h5{font-size:.875em}h6{font-size:.85em;color:#777}pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}pre *{background:#f7f7f7}a{color:#4078c0;text-decoration:none}a:hover{text-decoration:underline}code::after,code::before{letter-spacing:-.2em;content:"\00a0"} |
This file contains 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 Pubsub() { | |
this.events = {}; | |
} | |
Pubsub.prototype.publish = function(event, args) { | |
if (!this.events[event]) { | |
return false; | |
} | |
var subscribers = this.events[event]; |
This file contains 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
// This is the object that once its state changes, | |
// it will notify all the observers. | |
function Observable() { | |
this.observersList = []; | |
} | |
Observable.prototype.addObserver = function(observer) { | |
this.observersList.push(observer); | |
} | |
Observable.prototype.removeObserver = function (observer) { | |
var self = this; |
This file contains 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
// this is a test file indeed |