Skip to content

Instantly share code, notes, and snippets.

View lowiebenoot's full-sized avatar

Lowie Benoot lowiebenoot

  • Teamleader
  • Ghent, Belgium
View GitHub Profile
@lowiebenoot
lowiebenoot / why-did-you-render.js
Created June 20, 2017 09:21
Log why a react component rendered
componentDidUpdate(prevProps) {
Object.keys(this.props).forEach(key => {
if (this.props[key] !== prevProps[key]) {
console.log(key, "changed from", prevProps[key], "to", this.props[key]);
}
});
}
# creates a new gitignore file that ignores everything except the gitignore file itself
add_gitignore()
{
directory=$1
if [[ "$directory" == "" ]]
then
directory="."
fi