Skip to content

Instantly share code, notes, and snippets.

@yeluolei
yeluolei / app.js
Created September 8, 2017 03:09 — forked from acdlite/app.js
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@yeluolei
yeluolei / app.js
Created March 3, 2017 09:52 — forked from brianfeister/app.js
Angular Upload with Image Crop
angular.module('cropAndUpload', [
'angularFileUpload',
'ngImgCrop'
])
@yeluolei
yeluolei / xcode-build-bump.sh
Created May 20, 2016 06:51 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname