React Fiber is an ongoing reimplementation of React's core algorithm. It is the culmination of over two years of research by the React team.
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
| // https://github.com/andreypopp/autobind-decorator | |
| // https://github.com/facebook/codemod | |
| // Example replacement: | |
| // - @autobind onClick(e: SyntheticEvent) { | |
| // + onClick = (e: SyntheticEvent) => { | |
| codemod -m -d . --extensions js \ | |
| '@autobind\ ([a-zA-Z0-9]+)\(([^)]*)\)' \ | |
| '\1 = (\2) =>' |
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
| const immutableJSFormatter = { | |
| header(x) { | |
| if (x && x.toJS) return ['span', {}, x.toString()]; | |
| return null; | |
| }, | |
| hasBody(x) { | |
| return x && x.toJS; | |
| }, | |
| body(x) { | |
| return ['span', {}, JSON.stringify(x.toJS(), null, 2)]; |
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
| /** @jsx React.DOM */ | |
| 'use strict'; | |
| var React = require('react'); | |
| var ContentEditableLabel = React.createClass({ | |
| propTypes: { | |
| tag: React.PropTypes.func, |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
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
| import static org.hamcrest.MatcherAssert.assertThat; | |
| import static org.hamcrest.Matchers.equalTo; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.nio.charset.StandardCharsets; | |
| import java.util.Arrays; |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| # All Vagrant configuration is done here. The most common configuration | |
| # options are documented and commented below. For a complete reference, | |
| # please see the online documentation at vagrantup.com. | |
| # Every Vagrant virtual environment requires a box to build off of. | |
| config.vm.box = "ubuntu1204_64" |
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
| angular.module('test', []) | |
| .directive('placeholder', function($timeout){ | |
| var i = document.createElement('input'); | |
| if ('placeholder' in i) { | |
| return {} | |
| } | |
| return { | |
| link: function(scope, elm, attrs){ | |
| if (attrs.type === 'password') { | |
| return; |
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
| _ssh_auth_save() { | |
| ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh-auth-sock.$HOSTNAME" | |
| } | |
| alias screen='_ssh_auth_save ; export HOSTNAME=$(hostname) ; screen' | |
| alias tmux='_ssh_auth_save ; export HOSTNAME=$(hostname) ; tmux' |
NewerOlder
