This file contains 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 highland = require('highland'); | |
const request = require('request-promise') | |
const promiseToStream = highland; | |
const arrayToStream = highland; | |
const pollerToStream = highland; | |
function cowPageGenerator(url) { | |
let page = 1; | |
return (push, next) => { | |
push(null, request(url, {qs: {page: page++}})); |
This file contains 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
"use strict"; | |
var highland = require("highland"); | |
var request = require("request-promise"); | |
var promiseToStream = highland; | |
var arrayToStream = highland; | |
var pollerToStream = highland; | |
function cowPageGenerator(url) { | |
var page = 1; |
This file contains 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
"use strict"; | |
var highland = require("highland"); | |
var request = require("request-promise"); | |
var cowsay = require("cowsay"); | |
var promiseToStream = highland; | |
var arrayToStream = highland; | |
var pollerToStream = highland; | |
function cowPageGenerator(url) { |
This file contains 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
listen: | |
port: 443 | |
ssl: | |
certificate-file: /tmp/h2o/localhost.crt | |
key-file: /tmp/h2o/localhost.key | |
hosts: | |
"localhost": | |
paths: | |
"/": |
This file contains 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
var request = require('request-promise'); | |
var highland = require('highland'); | |
var promiseToStream = highland; | |
var arrayToStream = highland; | |
var pollerToStream = highland; | |
function eventTime(event) { | |
return new Date(event.createdAt).getTime(); | |
} |
This file contains 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
$ var personPromise = new Promise((resolve, reject) => { | |
setTimeout(function() { | |
reject('oh no'); | |
}, 1000); | |
}); | |
<await(person from personPromise)> | |
<div>Works</div> | |
<await-error>something went wrong</await-error> | |
</await> |
This file contains 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 client = sanityClient({ | |
projectId: 'p354jyup', | |
dataset: 'main', | |
useCdn: true, | |
}); | |
// needs polyfill | |
const origin = window.location.origin | |
client.clientConfig.cdnUrl = `${origin}/sanity`; |
This file contains 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 stiftemaskinenMachine = Machine({ | |
id: 'stiftemaskinen', | |
initial: 'pristine', | |
states: { | |
pristine: { | |
on: { | |
TOUCH_FORM: { | |
target: 'open', |
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains 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 rt from 'runtypes'; | |
export type JSONPrimitive = string | number | boolean | null; | |
export type JSONValue = JSONPrimitive | JSONObject | JSONArray; | |
export type JSONObject = { [member: string]: JSONValue }; | |
export type JSONArray = Array<JSONValue>; | |
type JSONRoot = JSONArray | JSONObject; | |
const JSONPrimitiveRt = rt.Intersect(rt.String, rt.Number, rt.Boolean, rt.Null); | |
const JSONValueRt: rt.Runtype<JSONValue> = rt.Lazy(() => |