Skip to content

Instantly share code, notes, and snippets.

Name of thing Sorta like... Mounted? Can you even setState? What would you say... ya do here?
constructor initialize() nope nope init stuff NO side effects
componentWillMount beforeDomReady() nope yeah but don't Only needed in createClass now use constructor for most things
render render nope please no render stuff and don't set any state please
componentDidMount domReady() yup yup DOM is a go init jQuery plugins dispatch stuff
componentWillReceiveProps onChange() yup yup
nikcub /
Created Oct 4, 2012
Facebook PHP Source Code from August 2007
View gist:2597326

Moving from jQuery


// jQuery
$(document).ready(function() {
  // code
wilsonpage / reqUrl.js
Created Nov 25, 2011
A function I made that wraps the node http.request function to make it a little more friendly. In my case I am using it for API route testing.
View reqUrl.js
// module dependencies
var http = require('http'),
url = require('url');
* UrlReq - Wraps the http.request function making it nice for unit testing APIs.
* @param {string} reqUrl The required url in any form
* @param {object} options An options object (this is optional)
sbussard / snippets.less
Last active Sep 26, 2015
css3 snippet
View snippets.less
.no-select {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
.no-drag {
-webkit-touch-callout: none;