Skip to content

Instantly share code, notes, and snippets.

@TheLarkInn
TheLarkInn / loadPresets.js
Created July 9, 2018 12:06
Load Preset
const webpackMerge = require("webpack-merge");
const applyPresets = (env = { presets: [] }) => {
const presets = env.presets || [];
/** @type {string[]} */
const mergedPresets = [].concat(...[presets]);
const mergedConfigs = mergedPresets.map(presetName => require(`./presets/webpack.${presetName}`)(env));
return webpackMerge({}, ...mergedConfigs);
};
@garyharan
garyharan / uncommit_and_stash.sh
Created February 7, 2019 16:02
How to stash your unpushed commits
$ git status
5 commits pending
$ git reset --soft HEAD~5 # where 5 is the number of commits you saw in the `git status`
$ git stash