I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
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 React, {Component} from 'react'; | |
| import createReactClass from 'create-react-class'; | |
| import PropTypes from 'prop-types'; | |
| // Problem: When writing React components, ES6 Classes present two annoyances: | |
| // 1. No lexical pre-binding of `this` in class method references. | |
| // 1a. Means we have to manually bind, but if we do that in render, we're | |
| // creating lots of extraneous anonymous functions every render | |
| // 1b. Alternately, we would have to meticulously "pre-bind" all of our | |
| // class methods in the constructor (see example `MyES6Component`) |
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
| ## I just ran into this after initializing a Visual Studio project _before_ adding a .gitignore file (like an idiot). | |
| ## I felt real dumb commiting a bunch of files I didn't need to, so the commands below should do the trick. The first two commands | |
| ## came from the second answer on this post: http://stackoverflow.com/questions/7527982/applying-gitignore-to-committed-files | |
| # See the unwanted files: | |
| git ls-files -ci --exclude-standard | |
| # Remove the unwanted files: | |
| git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached |