This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert'); | |
const flow = fns => v0 => { | |
const n = fns.length; | |
let i = -1; | |
let v = v0; | |
while (++i < n) v = fns[i](v); | |
return v; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert'); | |
function Foo(val) { | |
this.val = val; | |
} | |
const acceptInstanceOf = (cls, acceptFn, rejectFn) => { | |
return v => v instanceof cls | |
? acceptFn(v) | |
: rejectFn(v); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert'); | |
const partialLodash = require('lodash.partial'); | |
var protoSlice = Array.prototype.slice; | |
function partialApply(fn, v) { | |
return function() { | |
var args = protoSlice.call(arguments); | |
args.unshift(v); | |
return fn.apply(null, args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
type Cont<R, A> = (A => R) => R; | |
const ret = <R, A>(a: A): Cont<R, A> => | |
k => k(a); | |
const bind = <R, A, B>(cont: Cont<R, A>, fn: A => Cont<R, B>): Cont<R, B> => | |
k => cont(a => fn(a)(k)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
type Nothing = {| | |
type: 'nothing' | |
|}; | |
type Just<A> = {| | |
type: 'just', | |
value: A | |
|}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
type ContFn<A, B> = <C>(A, B => C) => C; | |
const sqr = <R>(v: number, ret: number => R): R => ret(v * v); | |
const dbl = <R>(v: number, ret: number => R): R => ret(v * 2); | |
const pipe = <A, B, C>(fn1: ContFn<A, B>, fn2: ContFn<B, C>): ContFn<A, C> => | |
<D>(v: A, ret: C => D): D => fn1(v, (res: B) => fn2(res, ret)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
type PipeObjMap<B,C> = <A>(A => B) => (A => C); | |
const pipeFn = <A,B,C>(fn1: A => B, fn2: B => C): (A => C) => (v: A) => fn2(fn1(v)); | |
const pipeObj = <Fns: {},B,C>(fns: Fns, fn2: B => C): $ObjMap<Fns, PipeObjMap<B,C>> => { | |
const res = {}; | |
for (const k in fns) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
type Msg<Type, V> = {| | |
type: Type, | |
val: V | |
|}; | |
type AcceptFn = | |
& (<A, B, OV>('val', Msg<'val', A> => B) => | |
(Msg<'val', A> | Msg<'err', OV>) => (B | Msg<'err', OV>)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
genFilename() { | |
cat /dev/random | LC_CTYPE=C tr -dc "[:alpha:]" | head -c 8 | |
} | |
slugify() { | |
echo "$@" | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/config/base.js b/src/config/base.js | |
index df9f1e9..a82f926 100644 | |
--- a/src/config/base.js | |
+++ b/src/config/base.js | |
@@ -1,5 +1,5 @@ | |
export default { | |
- API_PATH: '/mentor', | |
+ API_PATH: '/mentor/v2', | |
API_BASE_URL: null, | |
SENTRY_URL: null, |