A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
| #!/bin/bash | |
| # CentOS rbenv system wide installation script | |
| # Forked from https://gist.github.com/1237417 | |
| # Installs rbenv system wide on CentOS 5/6, also allows single user installs. | |
| # Install pre-requirements | |
| yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \ | |
| make bzip2 autoconf automake libtool bison iconv-devel git-core |
| #!/bin/bash | |
| set -e # exit on error | |
| ### README | |
| # * installs your desired ruby versions using rbenv | |
| # ** including openssl (needed by bundler) | |
| # ** including sqlite (probably needed for rails apps) | |
| # | |
| # Before you start: | |
| # * put ssh-keys in place |
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
| function getType (value) { | |
| let type = typeof value; | |
| if (type === 'object') { | |
| return value ? Object.prototype.toString.call(value).slice(8, -1) : 'null'; | |
| } | |
| return type; | |
| } | |
| [NaN, 0, 1, Infinity, // numbers | |
| null, undefined, false, 'str', // other primitives |
| // @flow | |
| // Flow Fundamentals For JavaScript Developers | |
| /* | |
| Tutorial for JavaScript Developers wanting to get started with FlowType. | |
| Thorough walkthrough of all the basic features. | |
| We will go through the basic features to gain a better understanding of the fundamentals. | |
| You can uncomment the features one by one and work through this tutorial. |
| function downloadFiles(files /*: Array<string> */) { | |
| // Do not fetch more than 8 files at a time | |
| const PARALLEL_DOWNLOADS = Math.min(8, files.length); | |
| // Create an Iterator from the array, this is our download queue | |
| const queue = files[Symbol.iterator](); | |
| // Channels are our download workers. As soon as a channel finishes downloading a file, | |
| // it begins fetching another file from the queue. Best effort | |
| const channels = []; | |
| // Create only PARALLEL_DOWNLOADS number of channels |
| class Foo { | |
| constructor(x,y,z) { | |
| Object.assign(this,{ x, y, z }); | |
| } | |
| hello() { | |
| console.log(this.x + this.y + this.z); | |
| } | |
| } |
| import React from "react"; | |
| import ReactDOM from "react-dom"; | |
| import configureStore from "./store/configureStore"; | |
| const store = configureStore(); | |
| const rootEl = document.getElementById("root"); |
| const curry = fn => (...args1) => { | |
| if (args1.length === fn.length) { | |
| return fn(...args1); | |
| } | |
| return (...args2) => { | |
| const args = [...args1, ...args2]; | |
| if (args.length >= fn.length) { | |
| return fn(...args); |
When a startup closes a new financing round (called a Series A, B, C, and so on), a new share class with preferred rights is usually created. These protect new investors in case the company gets sold at a lower valuation than the current financing round (while founders and employees might still get a pretty nice return). They are called liquidation preferences. When the company is sold (called an “exit”), the money of the exit has to be divided among all shareholders according to these liquidation preferences.
The basic rules are:
The investor gets paid back 1× their originally invested amount, nothing else. The rest is divided among all the other shareholders according to their ownership in the company (this is called “pro-rata”).