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
| var splitPolygon = require("split-polygon") | |
| var glmatrix = require("gl-matrix") | |
| var mat4 = glmatrix.mat4 | |
| var trimesh = grid_mesh({width:100,height:100}); | |
| var result = ""; | |
| result+='<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512"version="1.1">'; | |
| result+=renderComplex(trimesh.faces, trimesh.positions, { | |
| view: mat4.lookAt(mat4.create(), [5, 10, 20], [5,0,0], [2,0,2]), |
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
| var bunny = require("bunny") | |
| var mat4 = require("gl-matrix").mat4 | |
| var render = require("svg-3d-simplicial-complex") | |
| var result = ""; | |
| result +='<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512"version="1.1">'; | |
| result +=render(bunny.cells, bunny.positions, { | |
| view: mat4.lookAt(mat4.create(), [5, 10, 20], [0,2,0], [0,1,0]), | |
| projection: mat4.perspective(mat4.create(), | |
| Math.PI/4.0, |
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
| var Emitter = require('events').EventEmitter; | |
| var Actions = { | |
| create: function(actionName){ | |
| var sequence = []; | |
| sequence.push([function(result){ | |
| this.emit(result); | |
| }]); | |
| Actions[actionName] = function(params){ | |
| params._emitted = false; | |
| params.emit = function(result){ |
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
| The Grail: React based Isomorph apps framework | |
| Since Nodejs came into my life the idea of architecture that would allow me to build SPA apps that would render on server as well as on client. With Grail, Reactjs and React router this is possible right now without any side effects and with any kind of backend API. | |
| https://github.com/edjafarov | |
| eldar.djafarov.com | |
| ua.linkedin.com/in/edjafarov | |
| фоточка | |
| https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xpf1/t31.0-8/10369001_1385006371760316_9052772355397827709_o.jpg |
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
| // require() some stuff from npm (like you were using browserify) | |
| // and then hit Run Code to run it on the right | |
| var Emitter = require('component-emitter'); | |
| var ItemsStore = Emitter({ | |
| data: [{ | |
| name: "Skynet", | |
| description: "Superior artificial intelligence" | |
| }], | |
| init: function(context){ |
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
| var PromisePipe = require('promise-pipe')(); | |
| PromisePipe.use('add', function(data, context, num){ | |
| return data + num; | |
| }) | |
| var result = PromisePipe().add(5).then(think(1000)).add(10).then(showResult); | |
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
| var console = require("consoleit"); | |
| var PromisePipe = require("promise-pipe")(); | |
| var action = PromisePipe(); | |
| action(1).then(showResult); | |
| function showResult(result){ | |
| console.log(result) | |
| } |
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
| var console = require("consoleit"); | |
| var PromisePipe = require("promise-pipe")(); | |
| PromisePipe.use('reverse', function reverse(data){ | |
| if(!Array.isArray(data)) return Promise.reject(new Error('Data is not an Array')); | |
| return data.reverse(); | |
| }); | |
| PromisePipe.use('map', function map(data, context, mapFunction){ | |
| if(!Array.isArray(data)) data = [data]; |
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
| var console = require("consoleit"); | |
| var work = require('webworkify'); | |
| var PromisePipe = require("promise-pipe")(); | |
| if(typeof(window) !== "undefined"){ | |
| var w = work(require('index.js')); | |
| w.addEventListener('message', function (ev) { | |
| console.log(ev.data); | |
| }); | |
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
| module['exports'] = function(hook){ | |
| var Promise = require('promise'); | |
| var globalHandler = {}; | |
| (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
| module.exports = { | |
| ClientToHookStream: function Stream(hookUrl, fetchFn){ | |
| var fetchFn = fetchFn || fetch; | |
| var StreamHandler=null; | |
| return { |