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 co = require('co'); | |
var thunkify = require('thunkify'); | |
var request = require('request'); | |
var get = thunkify(request.get); | |
function *helper() { | |
yield get('http://google.com/'); | |
throw new Error('something unexpected happened'); | |
} |
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 bluebird = require('bluebird'); | |
var request = require('request'); | |
bluebird.promisifyAll(request); | |
bluebird.longStackTraces(); | |
var helper = bluebird.coroutine(function*() { | |
yield request.getAsync('http://google.com/'); | |
throw new Error('something unexpected happened'); | |
}); |
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 Style = React.createClass({ | |
render: function() { | |
var style = assign({}, this.props); | |
delete style.children; | |
return React.createElement( | |
'div', | |
{style: style, children: this.props.children} | |
); | |
} |
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 makeStyle(defaults, tagName) { | |
tagName = tagName || 'div'; | |
var Style = React.createClass({ | |
getDefaultProps: function() { | |
return assign({}, defaults); | |
}, | |
render: function() { | |
var style = assign({}, this.props); | |
delete style.children; |
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
'use strict'; | |
var React = require('react'); | |
var emptyFunction = require('../../jslib/emptyFunction'); | |
var throttle = require('lodash.throttle'); | |
var listening = false; | |
var instances = []; |
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
import os | |
import json | |
import subprocess | |
import sys | |
def relativize(path): | |
return os.path.relpath(os.path.abspath(path), os.path.abspath('.'))[:-3] | |
DEPS_MEMO = {} |
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 visitors = require('react-tools/vendor/fbtransform/visitors').transformVisitors; | |
var transform = require('react-tools/vendor/fbtransform/lib/transform').transform; | |
console.log(transform(visitors.react, '/** @jsx React.DOM */<p />').code); |
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 resetBrowserify(cb) { | |
window.require = null; | |
// TODO: somehow identify all browserified script tags | |
var scripts = Array.prototype.slice.call(document.querySelectorAll("script[src='build/browserified.js']")); | |
scripts.map(function(script) { | |
script.remove(); | |
var newScript = document.createElement('script'); | |
newScript.src = script.src; | |
document.head.appendChild(newScript); | |
}); |
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
<html> | |
<head> | |
<title>wtf</title> | |
</head> | |
<body> | |
yolo | |
<script> | |
window.addEventListener('mousemove', function() {}, false); | |
</script> | |
</body> |
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
<html> | |
<head> | |
<title>wtf</title> | |
</head> | |
<body> | |
yolo | |
<script> | |
window.addEventListener('mousemove', function() {}, false); | |
</script> | |
</body> |
OlderNewer