Skip to content

Instantly share code, notes, and snippets.

cookie1 2015-04-10 1
cookie1 2015-04-11 5
cookie1 2015-04-12 7
cookie1 2015-04-13 3
cookie1 2015-04-14 2
cookie1 2015-04-15 4
cookie1 2015-04-16 4
cookie2 2015-04-10 2
cookie2 2015-04-11 3
cookie2 2015-04-12 5
2015-03 2015-03-10 cookie1
2015-03 2015-03-10 cookie5
2015-03 2015-03-12 cookie7
2015-04 2015-04-12 cookie3
2015-04 2015-04-13 cookie2
2015-04 2015-04-13 cookie4
2015-04 2015-04-16 cookie4
2015-03 2015-03-10 cookie2
2015-03 2015-03-10 cookie3
2015-04 2015-04-12 cookie5
cookie1 2015-04-10 1
cookie1 2015-04-11 5
cookie1 2015-04-12 7
cookie1 2015-04-13 3
cookie1 2015-04-14 2
cookie1 2015-04-15 4
cookie1 2015-04-16 4
cookie2 2015-04-15 9
cookie2 2015-04-16 5
cookie1 2015-04-10 10:00:02 url2
cookie1 2015-04-10 10:00:00 url1
cookie1 2015-04-10 10:03:04 1url3
cookie1 2015-04-10 10:50:05 url6
cookie1 2015-04-10 11:00:00 url7
cookie1 2015-04-10 10:10:00 url4
cookie1 2015-04-10 10:50:01 url5
cookie2 2015-04-10 10:00:02 url22
cookie2 2015-04-10 10:00:00 url11
cookie2 2015-04-10 10:03:04 1url33
var content = require('fs').readFileSync('./jsbundle', 'utf8');
var text = content.slice(0);
var dx = "__d(";
var count = 0;
var graph = {};
while (text.indexOf(dx) > -1) {
count++;
//console.log('#' + count);
var start = text.indexOf(dx);
var end = text.slice(start + 2).indexOf(dx);
function pure(Clazz) {
Clazz.prototype.shouldComponentUpdate = function scu(nextProps, nextState) {
return shallowCompare(this, nextProps, nextState);
}
// 包装一层
clazz Wrapper extends React.Component {
render() {
var props = {};
each(this.props, function (key, val) {
function m1(next) {
console.log('1: start');
next();
console.log("1: end")
}
function m2(next) {
console.log('2: start');
next();
console.log('2: end');
function isObject(obj) {
return !!obj && typeof obj === 'object';
}
function find(arr, key, target) {
var len = arr.length;
for (var i = 0; i < len; i++) {
if (!arr[i]) continue;
if (arr[i][key] === target) return arr[i];
}
}
@ssnau
ssnau / index.js
Created July 8, 2015 08:29
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var React = require('react');
console.log(React.render);
function duration(ms) {
var du = moment.duration(ms / 1000, 'seconds');
var y = du.years();
var mon = du.months();
var d = du.days();
var h = du.hours();
var m = du.minutes();
var s = du.seconds();
return [