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
// Don’t ever use npm with sudo (eg: sudo npm install) except if you want to install a package. | |
// Problem is permissions issue in your our Home directory. | |
// reclaim ownership of the .npm directory. | |
sudo chown -R $(whoami) ~/.npm | |
// the write permission in node_modules directory: | |
sudo chown -R $(whoami) /usr/local/lib/node_modules |
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
var reactComponent = React.createClass({ | |
// The object returned by this method sets the initial value of this.state | |
getInitialState: function () { | |
return {}; | |
}, | |
// The object returned by this method sets the initial value of this.props | |
// If a complex object is returned, it is shared among all component instances | |
getDefaultProps: function () { |
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
<style> | |
.container { | |
height: 30px; | |
width: 340px; | |
padding: 2px 2px; | |
font-size: 12px; | |
} | |
.float { | |
float: left; | |
} |
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
var port = 8001; | |
var serverUrl = "127.0.0.1"; | |
var http = require("http"); | |
var path = require("path"); | |
var fs = require("fs"); | |
var url = require('url'); | |
var responseStartTime; | |
console.log("Web server starting at " + serverUrl + ":" + port); | |
var extensions = { |
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
// namespace - Utils | |
this.utils = this.utils || {}; | |
/** | |
* This provides a set of useful static functions for Object Comparison. | |
* All Static functions are Ported from Apache Flex mx.utils.ObjectUtil - ActionScript Code | |
* @author sanjay1909 | |
*/ | |
(function(){ | |
"use strict"; | |
//constructor |
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
<html> | |
<head> | |
<title>Scope Test</title> | |
<script> | |
function print(value, desc) { | |
var p = document.createElement("p"); | |
p.className = function(value){if(value == true) | |
return "pass"; | |
else if(value == false) | |
return "fail"; |