If you haven't used or heard of Rollup it is an awesome bundling system that allows you to leverage es2015 modules and produce backwards compatible libraries.
Here are a few configs to help you bundle your apps.
If you haven't used or heard of Rollup it is an awesome bundling system that allows you to leverage es2015 modules and produce backwards compatible libraries.
Here are a few configs to help you bundle your apps.
#!/bin/bash | |
# THESE ARE NOTES, NOT TESTED AS SCRIPT! | |
# We need the following to get and run teamcity agent | |
sudo apt-get install openjdk-7-jre-headless | |
sudo apt-get install unzip #For unzipping buildAgent.zip | |
# For compiling Simple.Web | |
sudo apt-get install ruby1.9.1 |
// from the brilliant mind of sb | |
var _catch = Promise.prototype.catch; | |
Promise.prototype.catch = function () { | |
return _catch.call(this, function (err) { setTimeout(function () { throw(err); }, 0); }); | |
} | |
// ------------ | |
// counterStore.js | |
// ------------ | |
import { | |
INCREMENT_COUNTER, | |
DECREMENT_COUNTER | |
} from '../constants/ActionTypes'; | |
const initialState = { counter: 0 }; |
export function createDynamicSelector() { | |
let subSelectors = null; | |
let actualSelector = null; | |
return (state, props, ...args) => { | |
// Check to see if the sub state has change | |
const subState = state.get('subState'); | |
if (subSelectors === null || !Set(subState.keys()).equals(Set(subSelectors.keys()))) { | |
// Rebuild our the selectors - could obviously update if required. | |
subSelectors = subState.map((value, key) => { |
/* | |
* This script will download a package (and all of its dependencies) from the | |
* online NPM registry, then create a gzip'd tarball containing that package | |
* and all of its dependencies. This archive can then be copied to a machine | |
* without internet access and installed using npm. | |
* | |
* The idea is pretty simple: | |
* - npm install [package] | |
* - rewrite [package]/package.json to copy dependencies to bundleDependencies | |
* - npm pack [package] |
const ABORTABLE_ERROR_KEY = '__abortablePromise'; | |
/** | |
* @typedef {Promise.<*>} AbortablePromise | |
* | |
* @property {function} abort Additional method for abort original promise | |
*/ | |
/** | |
* |
// Drop this in as the first plugin in a webpack config | |
{ | |
apply: function(compiler) { | |
var start; | |
compiler.plugin(['watch-run', 'run'], function(compiler, cb) { | |
start = Date.now(); | |
cb(); | |
}); | |
compiler.plugin('make', function(compilation, cb) { | |
console.log('pre-make', Date.now() - start); |
if (process.platform === 'darwin') { | |
try { | |
// Try our best to reuse existing tab | |
// on OS X Google Chrome with AppleScript | |
execSync('ps cax | grep "Google Chrome"'); | |
execSync( | |
'osascript chrome.applescript ' + protocol + '://localhost:' + port + '/', | |
{cwd: path.join(__dirname, 'utils'), stdio: 'ignore'} | |
); | |
return; |
#!/bin/bash | |
# We need the TAB character for SED (Mac OS X sed does not understand \t) | |
TAB="$(printf '\t')" | |
function abort { | |
echo "$(tput setaf 1)$1$(tput sgr0)" | |
exit 1 | |
} | |
function request_input { |