This file contains 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
<div> | |
<ComplexForm props={this.props.complexFormProps} /> | |
<ul> | |
<li prop={this.props.items[0]}>item A</li> | |
...1000 items... | |
</ul> | |
</div> |
This file contains 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
> ['important', 'starred'] === ['important', 'starred'] | |
false |
This file contains 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
const TodoItem = React.createClass({ | |
deleteItem() { | |
this.props.deleteItem(this.props.index); | |
}, | |
}); |
This file contains 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
> console.log.bind(null, 'hi') === console.log.bind(null, 'hi') | |
false | |
> function(){console.log(‘hi');} === function(){console.log(‘hi');} | |
false | |
// New function each time | |
render() { | |
return <MyComponent onClick={() => this.setState(...)} /> | |
} |
This file contains 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 class SampleComponent extends React.Component { | |
shouldComponentUpdate(nextProps, nextState) { | |
return !_.isEqual(this.props, nextProps) || | |
!_.isEqual(this.state, nextState); | |
} | |
render() { | |
return <div className={this.props.className}>foo</div>; | |
} | |
} |
This file contains 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
a["{\"msg\":\"added\",\"collection\":\"meteor_autoupdate_clientVersions\",\"id\":\"BHx6NPxiMDaJP84rN\",\"fields\":{\"current\":true}}"] | |
a["{\"msg\":\"added\",\"collection\":\"roles\",\"id\":\"B2ge3K5n7zbCtdDjj\",\"fields\":{\"name\":\"teacher\"}}"] | |
a["{\"msg\":\"added\",\"collection\":\"roles\",\"id\":\"Hg9a5ZJY2W45nTK32\",\"fields\":{\"name\":\"root\"}}"] | |
a["{\"msg\":\"added\",\"collection\":\"meteor_autoupdate_clientVersions\",\"id\":\"version\",\"fields\":{\"version\":\"a5bcf426e9c41894daf2061c9020c3d\"}}"] | |
a["{\"msg\":\"added\",\"collection\":\"meteor_autoupdate_clientVersions\",\"id\":\"version-cordova\",\"fields\":{\"version\":\"none\",\"refreshable\":false}}"] | |
a["{\"msg\":\"added\",\"collection\":\"meteor_autoupdate_clientVersions\",\"id\":\"version-refreshable\",\"fields\":{\"version\":\"ffc60b4f3427064574e698ced2533f82859b0494\",\"assets\":{\"allCss\":[{\"url\":\"/eccb300949f1901eca2ce08af04afb4e448cdf5b.css?meteor_css_resource=true\"}]}}}"] | |
["{\"msg\":\"method\",\"method\":\"login\",\"params |
This file contains 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
Template.workspaceBroadcast.workspace = function() { | |
return Workspaces.findOne(Session.get("selectedWorkspaceId")); | |
}; | |
Template.workspaceBroadcast.rendered = function() { | |
console.log('rendered'); | |
}; | |
Template.messages.messages = function(){ | |
return Messages.find({workspaceId: Session.get("selectedWorkspaceId")}, { sort: { submitted: -1 }}); |
This file contains 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
curl https://api.efatura.com/ \ | |
... | |
-d "receiver[name]=Foo" \ | |
-d "receiver[surname]=Bar" \ | |
-d "total=30.08" | |
... |
This file contains 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
╰─$ jitsu deploy 1 ↵ | |
info: Welcome to Nodejitsu aykutyaman | |
info: jitsu v0.12.11, node v0.8.21 | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command deploy | |
info: Analyzing application dependencies in server/server.js | |
info: Creating snapshot 0.1.1-18 | |
info Uploading: [=============================] 100% | |
error: Error running command deploy | |
error: Nodejitsu Error (500): Internal Server Error |
This file contains 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
Backbone.Validate = function(model, changedAttributes) { | |
return (function(patterns) { | |
var isNumeric = function(value){ | |
return _.isNumber(value) || | |
(_.isString(value) && value.match(patterns.number)); | |
}; | |
var hasValue = function(value) { | |
return !(_.isNull(value) || _.isUndefined(value) || (_.isString(value) && value === '')); |