Skip to content

Instantly share code, notes, and snippets.

View vjeux's full-sized avatar

Christopher Chedeau vjeux

View GitHub Profile
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
// 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 App = React.createClass({
render() {
<View ref="view" onDimensionsChange={(width, height) => { ... })/>
}
});
module.exports = App;

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

@vjeux
vjeux / gist:797361
Created January 26, 2011 20:20
Basic jQuery
/*!
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
/*!
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
@vjeux
vjeux / LICENSE.txt
Created May 22, 2011 19:02 — forked from WebReflection/LICENSE.txt
140byt.es -- Array Shuffle
Copyright (c) 2011 Christopher Chedeau, http://blog.vjeux.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
// Source: http://davidflanagan.com/Talks/jsconf11/BytesAndBlobs.html
// Load File
function loadBlob(path, callback) {
webkitRequestFileSystem( // Ask for filesystem
PERSISTENT, 50*1024*1024,
function(fs) { // When we get filesystem
fs.root.getFile( // Ask for a fs entry
path, {}, // With this name
function(entry) { // When we get entry
// Handle when the DOM is ready
ready: function( wait ) {
// Either a released hold or an DOMready/load event and not yet ready
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 1 );
}
// Remember that the DOM is ready
/* Input */
function f1(i) {
console.log('f1');
if (i) {
console.log(1);
} else if (i > 2)
console.log(2);
else if (true) {