Under EC2 select launch instances
Select the first instance linux box and proceed with the setup
| // experiment operators for most.js :D | |
| import {from, of} from 'most'; | |
| import {complement} from 'ramda'; | |
| const siphon = (pred, fn, stream) => from([stream.filter(pred).tap(fn).chain(most.empty), stream.filter(complement(pred))]).join(); | |
| const partition = (pred, stream) => from([stream.filter(pred), stream.filter(complement(pred))]); | |
| const partitionList = (pred, stream) => [stream.filter(pred), stream.filter(complement(pred))]; // [Streams] | |
| siphon(x => x % 2 === 0, () => console.log('side-effect'), of(2)); // => side-effect |
| var most = require('most'); | |
| var multicast = require('most').multicast; | |
| var snabbdom = require('snabbdom'); | |
| console.log(multicast); | |
| var patch = snabbdom.init([ | |
| require('snabbdom/modules/class'), | |
| require('snabbdom/modules/props'), | |
| require('snabbdom/modules/style'), |
| var through = require('through2').obj; | |
| var from = require('from2'); | |
| var most = require('most'); | |
| var count = 0; | |
| var gen = function gen(size, next) { | |
| if (count++ < 20) { | |
| return next(null, {val: count}); | |
| } | |
| }; |
| var most = require('most'); | |
| var s = most.iterate(function(x) { | |
| return x + 1; | |
| }, 0).take(100); | |
| const tails = function(stream) { | |
| const t = stream.multicast(); | |
| return t.constant(t).startWith(t); | |
| }; |
| // clear node repl | |
| // \u001B[2J clear terminal | |
| // \u001B[0;0f cursor back to position 0,0. | |
| process.stdout.write('\u001B[2J\u001B[0;0f'); |
| var R = require('ramda'); | |
| var S = require('sanctuary'); | |
| var getElement = R.bind(document.querySelector, document); | |
| var getElements = R.bind(document.querySelectorAll, document); | |
| var container = getElement('.container'); | |
| var others = getElements('.other'); | |
| var log = R.tap(R.bind(console.log, console)); | |
| var noise = function(x){ | |
| console.log(x.target); | |
| }; |
| var partial = function partial(fn){ | |
| var args = Array.apply(null, arguments).slice(1); | |
| return function(){ | |
| var lastArgs = Array.apply(null, arguments); | |
| return fn.apply(this, args.concat(lastArgs)); | |
| }; | |
| }; | |
| var partialRight = function partialRight(fn){ | |
| var args = Array.apply(null, arguments).slice(1); |
| // Tackling async events without | |
| // callbacks using es6 generators | |
| // http://kangax.github.io/compat-table/es6/#generators_(yield) | |
| var async = function(parameters, callback) { | |
| setTimeout(function() { | |
| callback(parameters); | |
| }, 1000); | |
| }; | |
| var currier = function(fn) { |
| { | |
| "env": { | |
| "browser": true, | |
| "node": true | |
| }, | |
| "rules": { | |
| "block-scoped-var": 2, | |
| "complexity": [1, 5], | |
| "consistent-return": 2, |