A String expression of the Promise chain.
Mapping promise methods to a string expression.
Pipeline would always pass the result to the down stream.
// Common part | |
// index.js | |
import { combineReducer } from 'redux'; | |
import reducer from './reducer'; | |
export default combineReducer({ | |
deep: reducer, | |
}); | |
// reducer.js | |
import { combineReducer } from 'redux'; | |
const idsReducer = (state = EMPTY_LIST, action) => { |
#!/bin/sh | |
REMOTE=${1:-'origin'} | |
echo "git fetch $REMOTE" | |
git fetch $REMOTE | |
echo "git checkout $REMOTE/master" | |
git checkout $REMOTE/master | |
echo "yarn run build" | |
yarn run build |
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |
sb = new StateBuilder() | |
state = sb.setQuery({}) | |
.setConverstion.setMultipleChoiceQuestion({}) | |
.setConverstion.setFreeTextQuestion({}) | |
.build() | |
class StateBuilder extends GenericStateBuilder { | |
constructor(args) { | |
super(args) |
#!/bin/bash | |
set -euo pipefail | |
# Install nodejs and npm | |
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - | |
sudo yum install -y -q nodejs | |
# Install yarn | |
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo | |
sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg |
const SCALE = 1000; | |
const rounds = 10; | |
// Standard Normal variate using Box-Muller transform. | |
function randn_bm() { | |
let u = 0, v = 0; | |
while(u === 0) u = Math.random(); //Converting [0,1) to (0,1) | |
while(v === 0) v = Math.random(); | |
let num = Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v ); | |
num = num / 10.0 + 0.5; // Translate to 0 -> 1 |
Client side project deployment
Lint + Unit test on Gitlab