Skip to content

Instantly share code, notes, and snippets.

import path from 'path';
import webpack from 'webpack';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import UglifyJsPlugin from 'uglifyjs-webpack-plugin';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import Dotenv from 'dotenv-webpack';
import HardSourceWebpackPlugin from 'hard-source-webpack-plugin';
import { BundleStatsPlugin } from './plugins/BundleStatsPlugin';
import { LoadableStatsPlugin } from './plugins/LoadableStatsPlugin';
import generateStats from './generate-stats';
.even {
background-color: lavenderblush;
}
.odd {
background-color: goldenrod;
}
.even {
background-color: lavenderblush;
}
.odd {
background-color: goldenrod;
}
// HOC and context
// provide context with HOC
import App from './components/App';
import ProvideContext from './containers/ProvideContext';
const transportationTypes = [
'armored car',
'fire engine',
'golf cart',
const transportationList = (
<ul>
<li>Armored Car</li>
<li className="active">Hyperloop</li>
</ul>
);
ReactDOM.render(
transportationList,
document.getElementById(‘app’)
git ls-remote https://github.com/docker/compose | grep refs/tag | grep -o "[0-9]\.[0-9]\{1,2\}\.[0-9]\{1,2\}$" | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1

Bubble Sort

  • good for nearly sorted lists
  • look at consecutive pairs
  • passes over entire list
    • everytime do a pass, the largest card in first pair not in correct position will be moved into correct position
  • each pass one card is guaranteed to be moved to correct position

Variables

  • $0 - The name of the Bash script.
  • $1 - $9 - The first 9 arguments to the Bash script. (As mentioned above.)
  • $# - How many arguments were passed to the Bash script.
  • $@ - All the arguments supplied to the Bash script.
  • $* - All the arguments supplied to the Bash script seperated by the IFS.
  • $? - The exit status of the most recently run process.
  • $$ - The process ID of the current script.
  • $USER - The username of the user running the script.
  • $HOSTNAME - The hostname of the machine the script is running on.
[{
"_id": "58c761f1364d84385f960739",
"sn_number": "",
"w_number": "w0001",
"stage": "Busbar Welding",
"status": "WIP",
"type": "Dev",
"active": true,
"url": "string",
"__v": 0,
import React, {createClass} from 'react';
import {assign} from 'lodash';
import hoistNonReactStatics from 'hoist-non-react-statics';
function createComponent(Component, dataBindings) {
const displayName = `ProvideContextComponent(${Component.displayName || Component.name})`;
const ProvideContextComponent = createClass({
displayName,