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.
// 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); |
const ABORTABLE_ERROR_KEY = '__abortablePromise'; | |
/** | |
* @typedef {Promise.<*>} AbortablePromise | |
* | |
* @property {function} abort Additional method for abort original promise | |
*/ | |
/** | |
* |
/* | |
* 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] |
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) => { |
// ------------ | |
// counterStore.js | |
// ------------ | |
import { | |
INCREMENT_COUNTER, | |
DECREMENT_COUNTER | |
} from '../constants/ActionTypes'; | |
const initialState = { counter: 0 }; |
// 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); }); | |
} | |
#!/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 |
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.
Shipit is a pretty awesome universal automation and deployment tool written in JavaScript.
(this would ideally be done with automated provisioning)
npm install -g pm2
npm install -g shipit-cli
These instructions will set up local-npm so that it runs as a launch daemon, meaning that it will start up whenever you log in.
First, install local-npm
and pm2
:
npm install -g local-npm
npm install -g pm2