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 PIXI = require('pixi.js') | |
console.log(PIXI) |
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 JSONStream = require('jsonstream') | |
var es = require('event-stream') | |
function handleRequest(data, callback) { | |
callback(null, JSON.stringify(data) + '\n') | |
} | |
process.stdin | |
.pipe(JSONStream.parse()) | |
.pipe(es.map(handleRequest)) |
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 React from 'react' | |
import warning from 'warning' | |
const { number, object } = React.PropTypes | |
const WindowScrollTo = React.createClass({ | |
contextTypes: { | |
windowScrollTo: object | |
}, |
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 fetchJSON(url, options, callback) { | |
if (typeof options === 'function') { | |
callback = options | |
options = {} | |
} | |
options = options || {} | |
const headers = (options.headers || (options.headers = {})) | |
headers.Accept = 'application/json' |
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 webpackUniversalModuleDefinition(root, factory) { | |
if(typeof exports === 'object' && typeof module === 'object') | |
module.exports = factory(); | |
else if(typeof define === 'function' && define.amd) | |
define([], factory); | |
else if(typeof exports === 'object') | |
exports["HTTPClient"] = factory(); | |
else | |
root["HTTPClient"] = factory(); | |
})(this, function() { |
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
<div className="pricing" style={{ opacity: purchasing ? 0.25 : '' }}> | |
{purchaseComplete ? ( | |
<div className="purchase-complete"> | |
<h2>Thanks!</h2> | |
<p> | |
Thank you for your purchase of {formatPrice(this.state.total)}. | |
We’ll send you a receipt shortly. | |
</p> | |
<p> | |
<button |
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 React from 'react' | |
// So, this is awesome. And it's the approach I took in my own site. | |
// Nothing wrong with it! | |
const IconUmbrella = React.createClass({ | |
render() { | |
return ( | |
<svg className="umbrella" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" aria-labelledby="umbrella icon"> | |
<title>Umbrella</title> | |
<path d="M27 14h5c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2v0zM27 14c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2v0 14c0 1.112-0.895 2-2 2-1.112 0-2-0.896-2-2.001v-1.494c0-0.291 0.224-0.505 0.5-0.505 0.268 0 0.5 0.226 0.5 0.505v1.505c0 0.547 0.444 0.991 1 0.991 0.552 0 1-0.451 1-0.991v-14.009c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2c0-5.415 6.671-9.825 15-9.995v-1.506c0-0.283 0.224-0.499 0.5-0.499 0.268 0 0.5 0.224 0.5 0.499v1.506c8.329 0.17 15 4.58 15 9.995h-5z"/> |
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
{ | |
"extends": "airbnb", | |
"parser": "babel-eslint", | |
"rules": { | |
"array-bracket-spacing": [2, "always"], | |
"comma-dangle": 0, | |
"consistent-return": 1, | |
"curly": [1, "multi-or-nest", "consistent"], | |
"eqeqeq": [2, "smart"], | |
"max-len": 1, |
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 throttle from 'lodash/throttle' | |
import React, { PropTypes } from 'react' | |
const ThrottledInput = React.createClass({ | |
propTypes: { | |
delay: PropTypes.number | |
}, | |
getDefaultProps() { | |
return { |
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
/** | |
* Registers the given callback to be called in the node.js callback | |
* style, with error as the first argument, when the promise resolves. | |
* | |
* Also, returns a function that may be used to prevent the callback | |
* from ever being called. Calling the returned function is synonymous | |
* with saying "I no longer care about the resolution of this promise, | |
* even if it fails." | |
* | |
* Since there is no provision in the promise spec for cancel/abort |