Skip to content

Instantly share code, notes, and snippets.

View vjeux's full-sized avatar

Christopher Chedeau vjeux

View GitHub Profile
#3229: Add websocket JS tests and call onclose on failure
leeyeh, hharnisc, vjeux
#3204: Add --write-sourcemap option to 'bundle' cli command (fixes
arthuralee, tdzl2003, kassens
#3193: Add --verbose option to react-native-cli (fixes #2797)
frantic, nsimmons, jmhdez
#3190: fix incorrect count for layoutAnimation callback

Steve Klabnik: Node enabled an entire generation of programmers who would only ever be "front end devs" that only have done a little bit of jquery and enabled them to write backend code. That was a new superpower for them. This whole group of people now have this ability to do this brand new thing in computing. We've seen those fantastic things sort of fall out of that with all these new people getting excited. What i'm hoping is that if you've never done system programming before that Rust will be able to help ease you into doing this kind of low level programming.

Yehuda Katz: One thing that you can bet will happen is the exact same thing that happened with node is that there's all those people out there who are already system programmers, just like there were all these people who were already backend programmers, and they didn't get the enabling power of node. You'll hear people say "I don't understand why Rust is so important, i can do all this stuff with C++". "Look at my C++ code i'm already doing all

var App = React.createClass({
render() {
<View ref="view" onDimensionsChange={(width, height) => { ... })/>
}
});
module.exports = App;
// Can't do that with inline styles, they don't have access to pseudo selectors
body::before { content: "Thanks Obama"; }
textarea.post-comment::before {
  content: "Please enter your password to post a comment...";
}
.container::before { content: url(http://example.com/processIntensiveEndpoint); }
.another::before { content: url(http://example.com/processIntensiveEndpoint?1); }
body::before { content: url(http://example.com/processIntensiveEndpoint?2); }
var React = React.createClass({
render() {
// React.createElement instead of template string
return React.createElement('div', { className: 'frames-wrapper' },
React.createElement('div', { className: 'x-gif__frames' })
);
},
componentDidMount() {
// this.props instead of attrs
var React = React.createClass({
componentDidMount() {
// this.props instead of attrs
var xGif = this.xGif = Object.create(this.props, {
fire: {
value: function (event) {
console.log(event);
}
}
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*
* @providesModule deepFreezeAndThrowOnMutationInDev
*/
/**
* If your application is accepting different values for the same field over
* time and is doing a diff on them, you can either (1) create a copy or
* (2) ensure that those values are not mutated behind two passes.
var SomeClassClosure = function() {
this.method = function() {}
}
new SomeClassClosure
// {method: fnA()}
new SomeClassClosure
// {method: fnB()} // a new fn is allocated each time
var SomeClassPrototype = function() {}
var SomeClass = function() {
// constructor
}
copyProperties(SomeClass, {
staticMethodA: function() {
}
})
var Button = React.createClass({
// Lots of complicated stuff
render: function() {
return (
// the designer can tweak this rendering as well
<span style={[styles.normal, this.props.active && styles.active]} >
// ...
</span>