Skip to content

Instantly share code, notes, and snippets.

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFAjjOZ1U8EFamVd1qA9WjP2ZHWOGKNe+nbgYWpN9YwA
#!/bin/bash
PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/phil/.bin"
RSYNC_ROOT_EXCLUDES="
--exclude /cdrom/
--exclude /dev/
--exclude /exports/
--exclude /proc/
--exclude /run/
--exclude /sys/
// Class component with lifecycle hook
componentDidUpdate(prevProps, prevState) {
Object.entries(this.props).forEach(([key, val]) =>
prevProps[key] !== val && console.log(`Prop '${key}' changed`)
);
Object.entries(this.state).forEach(([key, val]) =>
prevState[key] !== val && console.log(`State '${key}' changed`)
);
}

Keybase proof

I hereby claim:

  • I am notafunction on github.
  • I am mattlatham (https://keybase.io/mattlatham) on keybase.
  • I have a public key ASCD1q1qZCZw4nTODrgjmtL1plYYWyXafUlxHAEFyZklLwo

To claim this, I am signing this object:

@notafunction
notafunction / webpack.config.js
Last active May 30, 2017 23:42
Tree-shaking Webpack 2 configuration for React projects.
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const PreloadWebpackPlugin = require('preload-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
const host = process.env.HOST || 'localhost';
@notafunction
notafunction / _fa-social-color.scss
Created October 27, 2016 02:49
Colorized Font Awesome brand icons
// Brand Colors
$fa-500px: #0099e5;
$fa-adn: #4A484C;
$fa-amazon: #ff9900;
$fa-android: #a4c639;
$fa-angellist: #000;
$fa-apple: #979797;
$fa-behance: #1769ff;
$fa-behance-square: $fa-behance;
$fa-bitbucket: #205081;