add this in ~/.bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
const counter = (state = 0, action) => { | |
switch(action.type){ | |
case 'INCREMENT': | |
return state + 1; | |
case 'DECREMENT': | |
return state - 1; | |
default: | |
return state; | |
} | |
} |
const counter = (state = 0, action) => { | |
switch(action.type){ | |
case 'INCREMENT': | |
return state + 1; | |
case 'DECREMENT': | |
return state - 1; | |
default: | |
return state; | |
} | |
}; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://fb.me/react-0.14.0.js"></script> | |
<script src></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.min.js"></script> | |
<script src="https://fb.me/react-dom-0.14.0.js | |
"></script> | |
<title>React-Redux First Touch :)</title> |
exports.createHandler = function (method) { | |
return new Handler(method); | |
} | |
Handler = function(method) { | |
this.process = function(req, res) { | |
params = null; | |
return method.apply(this, [req, res, params]); | |
} | |
} |
#!/bin/bash | |
set -e | |
COMPANY_REMOTE=plucky | |
git fetch $COMPANY_REMOTE | |
git checkout master | |
git reset --hard $COMPANY_REMOTE/master | |
git merge --no-ff $COMPANY_REMOTE/develop |
redux-demo |
// Restify Server CheatSheet. | |
// More about the API: http://mcavage.me/node-restify/#server-api | |
// Install restify with npm install restify | |
// 1.1. Creating a Server. | |
// http://mcavage.me/node-restify/#Creating-a-Server | |
var restify = require('restify'); |
https://developer.atlassian.com/blog/2015/11/scripting-with-node/ |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |