Skip to content

Instantly share code, notes, and snippets.

View sonthonaxrk's full-sized avatar
👁️
Focusing

RK sonthonaxrk

👁️
Focusing
View GitHub Profile
Rollos-Mac-Pro:react-boilerplate Rollo$ npm install jest-cli
npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"1.7.2","npm":"2.7.6"})
> [email protected] install /Users/Rollo/react-boilerplate/node_modules/jest-cli/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading tarball
gyp ERR! stack at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:246:14)
(django-dropoff)Rollos-Mac-Pro:backbone-playground Rollo$ babel-node /usr/local/bin/node-debug .
Node Inspector is now available from http://localhost:8080/debug?port=5858
Debugging `.`
Debugger listening on port 5858
/Users/Rollo/Developer/backbone-playground/src/lib/Model.js:1
(function (exports, require, module, __filename, __dirname) { class Model {
^^^^^
SyntaxError: Unexpected reserved word
at exports.runInThisContext (vm.js:53:16)
(django-dropoff)Rollos-Mac-Pro:backbone-playground Rollo$ babel-node ./node_modules/.bin/mocha
/Users/Rollo/Developer/backbone-playground/src/lib/Model.js:1
(function (exports, require, module, __filename, __dirname) { class Model {
^^^^^
SyntaxError: Unexpected reserved word
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:393:25)
at Object.Module._extensions..js (module.js:428:10)
at Module.load (module.js:335:32)
at Function.Module._load (module.js:290:12)
class Model {
constructor(string) {
this.id = 20;
this.name = string;
}
}
module.exports = Model;
function JSONResource(obj) {
this._watchFields = new Array();
this._serverCopy = obj;
for (var field in obj) {
if (obj.hasOwnProperty(field)) {
this._watchFields.push(field);
this[field] = obj[field];
}
}
function JSONResourceCollection(source, Type) {
if (Type.prototype.isPrototypeOf(JSONResource.prototype)) {
this.Type = Type;
} else {
// this get's thrown
throw "The Type must be a subclass of JSONResource";
}
}
JSONResourceCollection("http://example.com/", JSONResource);
React.render(
<MainViewContainer/>,
document.getElementById("main-area")
);
React.render(
<MainSideMenu/>,
document.getElementById("sidemenu-nav")
);
var ProductSearch = React.createClass({
filterList: function(event){
//debugger;
var updatedProducts = this.state.initialProducts;
updatedProducts = updatedProducts.filter(function(item){
return item.name.toLowerCase().search(event.target.value.toLowerCase()) !== -1;
});
this.setState({filteredProducts: updatedProducts});
},
function myFunction() {
console.log("Hello World");
}
var SearchBar = React.createClass({
render: function() {
return (
<button type="button" onClick= { myFunction() } >Continue</button>
);
},
var SearchBar = React.createClass({
render: function() {
return (
<div className="search-large-wrap">
<div className="search-large-textfield-wrap">
<input placeholder="Search For Existing Products" type="search" className="search-large-textfield" id="search-products"></input>
</div>
<div className="search-large-submit-wrap">
<button type="button" className="search-large-submit" id="add-products" >Continue</button>
</div>