How to filter emails from GitHub in Gmail and flag them with labels.
The labels in this document are just examples.
| Filter | Label |
|---|
| // 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) =>' |
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.
| 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)]; |
| /** @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.
| 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; |
| # -*- 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" |
| 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; |