Skip to content

Instantly share code, notes, and snippets.

import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };

Javascript

Javascript: The Good Parts -- Beginner/Intermediate

http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742

Legendary book, a must-read for any Javascript programmer at least once. Goes into the basics of Javascript with the assumption that the reader is an experienced programmer already, coming from another language or already understands a fair bit about Javascript itself. Very good review of basics and more advanced concepts (like scope/closure, functions as first class objects, etc).

Javascript Design Patterns (Stoyan Stefanov) -- Intermediate

//Create a new Graph Object
FB.api(
'me/objects/video.movie',
'post', {
'object': {
'title': 'Sample Movie',
'type': 'video.movie',
'image': 'http://stuffpoint.com/cats/image/41633-cats-cute-cat.jpg',
'url': 'http://localhost:9000',
'description': 'Example Description Here',