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
package main | |
import ( | |
"fmt" | |
"log" | |
"gopkg.in/yaml.v2" | |
) | |
type Environment struct { |
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
import * as future from './future'; | |
import * as result from './result'; | |
import { get } from 'https'; | |
interface Tuple { | |
name: string; | |
len: number; | |
} | |
function printTuple(tuple: Tuple): void { |
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
import { Observable } from 'rxjs/Rx'; | |
type Tuple<T, U> = [T, U]; | |
/** | |
* Operator which for values of a promise to be concated to an emission of the observable. For each | |
* emission, the result of the promise will be triggered and appended into an array with the | |
* emitted value, which can be used in the next emission block. Returns a lambda that can be used | |
* within `let`, for example. | |
* |
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
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; | |
function without<T extends object, K extends keyof T>( | |
obj: T, | |
key: K, | |
): Omit<T, K> { | |
const newObj = Object.assign({}, obj); | |
delete newObj[key]; | |
return newObj; | |
} |
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
type Pred<T, U extends T> = (v: T) => v is U; | |
function filter<T, U extends T>(coll: T[], pred: Pred<T, U>): U[] { | |
const seed: U[] = []; | |
return coll.reduce((acc: U[], val: T) => { | |
if (pred(val)) { | |
return [...acc, val]; | |
} | |
return acc; | |
}, seed); |
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
interface Vehicle { | |
color: string; | |
} | |
interface Car extends Vehicle { | |
drive: () => void; | |
} | |
interface Bike extends Vehicle { | |
peddle: () => void; |
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
import Rx = require('rxjs/Rx'); | |
interface Obj { | |
id: number; | |
} | |
type Chunk = Obj[] | |
const chunks$: Rx.Observable<Chunk> = Rx.Observable.from([ | |
[ { id: 1 }, { id: 2} ], |
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
import Rx = require('rxjs/Rx'); | |
interface Obj { | |
id: number; | |
} | |
type Chunk = Obj[] | |
const chunks$: Rx.Observable<Chunk> = Rx.Observable.from([ | |
[ { id: 1 }, { id: 2} ], |
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 Rx = require('rxjs/Rx'); | |
const PERFORM = 1; | |
const INVALIDATE_CACHE = 2; | |
function asyncOp() { | |
return Promise.resolve(Date().toString()); | |
} | |
const clearCacheInterval$ = Rx.Observable.interval(5000); |
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
Fetching metadata from s3://transit-hub-gtfs/normalized/Oceania/Australia/AirlieBeach-TransLinkBrisbane.zip...done | |
MD5 mismatch w/ import history in db, downloading bundle...done | |
Importing airliebeach-translinkbrisbane data...done (1s) | |
NOTICE: no non-null/empty features, unable to compute statistics | |
NOTICE: no non-null/empty features, unable to compute statistics | |
Fetching metadata from s3://transit-hub-gtfs/normalized/North-America/United-States-of-America/New-York/Albany-CDTA.zip...done | |
MD5 mismatch w/ import history in db, downloading bundle...done | |
Importing albany-cdta data...done (21s) | |
Fetching metadata from s3://transit-hub-gtfs/normalized/North-America/United-States-of-America/Texas/Austin-Capmetro.zip...done | |
MD5 mismatch w/ import history in db, downloading bundle...done |