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
| interface IComponentAProps { | |
| fromB: string; | |
| onChange: (t: string) => void; | |
| } | |
| class ComponentA extends Component<IComponentAProps, void> { | |
| render() { | |
| return ( | |
| <View> |
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
| export default class Router extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.renderScene = this.renderScene.bind(this); | |
| } | |
| componentWillReceiveProps(nextProps) { | |
| if (this.props.router.currentRoute === nextProps.router.currentRoute) { return; } | |
| const {closeSideMenu} = this.props; | |
| switch (nextProps.router.type) { |
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
| ______) _____ | |
| (, / (, / | | |
| / ______ /---| _/_ | |
| ) / (_) // (_ ) / |_(_(_(__(_/_ | |
| (_/ (_/ .-/ | |
| (_/ |
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
| import _ from 'lodash'; | |
| const _internal = new WeakMap(); | |
| class Inventory { | |
| /** | |
| * | |
| * @constructs Inventory | |
| * @classdesc An inventory is a collection of Item objects, belonging to an Entity, with a capacity | |
| * | |
| * @param {Entity} belongsTo - The entity that has this inventory |
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
| .main-header { | |
| display: none; | |
| } | |
| .page-list { | |
| background: black; | |
| } |
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
| // hover | |
| var i = undefined; | |
| $('a').mouseover(function() { | |
| var dest = $(this); | |
| var string = dest.text(); | |
| var c = 0; | |
| dest.text(''); | |
| i = setInterval(function () { | |
| if (c >= string.length) { | |
| clearInterval(i); |
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
| // removed "limit" from query params | |
| var url = "http://api.tumblr.com/v2/blog/manarecs.tumblr.com/posts?api_key=2Waj1PmWwaIcu49hUVPTb4WOwWNOp1uOkhP4vjn0Fe3g7zB7Ss"; | |
| $.getJSON(url, function(results){ | |
| // The latest post is last | |
| var latest = results.reponse.posts.reverse()[0]; | |
| // Make DOM element with this latest post data | |
| // Not familiar enough with jQuery + page HTML to do this | |
| }); |
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
| if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); | |
| var container, stats; | |
| var camera, scene, renderer, objects; | |
| var particleLight; | |
| var dae; | |
| var loader = new THREE.ColladaLoader(); |
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
| // Say a constructed object takes three arguments and you dont need to reference them after they're constructed | |
| args = [ | |
| [ 7, 10, true ] | |
| [ 9, 1, true ] | |
| [ 4, 6, true ] | |
| [ 1, 9, false ] | |
| ] | |
| for (i in args) { |
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
| These are the resources that helped me get from javascript proletariat to javascript bourgeoisie (: | |
| Javascript: The Good Parts (General JS) | |
| http://eleventyone.done.hu/OReilly.JavaScript.The.Good.Parts.May.2008.pdf | |
| Hands-on Node.js (Node) | |
| http://nodetuts.com/pdf/handson-nodejs-sample.pdf | |
| Stream Handbook (Node) | |
| https://github.com/substack/stream-handbook |
NewerOlder