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
'use strict' | |
var React = require('react') | |
var events = require('events') | |
var store = new events.EventEmitter | |
var roll = require('./roll') | |
var Notify = React.createClass({ | |
mixins: [roll({timeout: 1500}, store)] |
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
'use strict' | |
var es = require('event-stream') | |
var assign = require('object-assign') | |
// dispatcher | |
var dispatcher = es.map(function (payload, cb) { | |
cb(null, payload) | |
}) | |
// actions | |
var act = assign(es.map(function (payload, cb) { |
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
'use strict' | |
var dispatcher = module.exports = new (require('flux').Dispatcher) | |
var dispatch = dispatcher.dispatch | |
var register = dispatcher.register | |
dispatcher.dispatch = function (actionType, value) { | |
var payload = {actionType: actionType} | |
if ('undefined' !== typeof value) payload.value = value | |
return dispatch.apply(this, [payload]) |
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
'use strict' | |
var handle = require('./handle') | |
var events = require('events') | |
var assign = require('object-assign') | |
var list = [] | |
var api = assign({}, events.EventEmitter.prototype) | |
// API | |
// handle.call( |
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
<!doctype html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css" /> | |
<style> | |
* { | |
margin : 0; | |
padding : 0; | |
} | |
main: { | |
display : block; |
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 test = require('tape').test | |
var stream = require('stream') | |
function setup (src) { | |
var queue = src.slice(0) | |
var rs = new stream.Readable({objectMode: true}) | |
rs._read = function () { | |
this.push(queue.shift() || null) | |
} |
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 path = require('path') | |
var fs = require('fs') | |
var OpmlParser = require('opmlparser') | |
var semaphore = require('semaphore') | |
var request = require('request') | |
var FeedParser = require('feedparser') | |
var export_xml = path.join(__dirname, './export.xml') | |
var lock_capacity = 3 | |
var timeout = 5000 |
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 util = require('util') | |
var stream = require('stream') | |
var semaphore = require('semaphore') | |
function SemaphoreStream (count, option) { | |
stream.Duplex.call(this, (option || {})) | |
this.semaphore = semaphore(count) | |
this.finished = false |
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
<!doctype html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Ractiv.ate</title> | |
<head> | |
<body> | |
<div id="main"></div> | |
<script src="./bundle.js"></script> | |
</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
var app = Object.create(require('carom.js')).constructor() | |
function onError (err, req, res) { | |
console.error(err) | |
console.error(err.stack) | |
res.writeHead(500) | |
res.end(String(err)) | |
} |