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
<!doctype html> | |
<html> | |
<div id="content"></div> | |
<style> | |
body { | |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
font-size: 14px; | |
line-height: 20px; | |
} |
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 https = require('https'); | |
var Rx = require('rx'); | |
/** | |
Wrap Node's https.request() in an RxJS observable | |
**/ | |
function nodeRxXhr(options, postData) { | |
return Rx.Observable.create(function(obs) { | |
var req = https.request(options, function(res) { | |
res.setEncoding('utf8'); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Foo Branching</title> | |
<style type="text/css"> | |
.gitgraph-tooltip { | |
position: absolute; |
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 express = require('express'); | |
const http = require('http'); | |
const url = require('url'); | |
const WebSocket = require('ws'); | |
const app = express(); | |
app.use(function (req, res) { | |
res.send({}); | |
}); |
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
# /srv/salt/upgrade_the_app.sls | |
# Example of a complex, multi-host Orchestration state that performs status checks as it goes. | |
# Note, this is untested and is meant to serve as an example. | |
# Run via: salt-run state.orch upgrade_the_app pillar='{nodes: [nodeA, nodeB], version: 123}' | |
{% set nodes = salt.pillar.get('nodes', []) %} | |
{% set all_grains = salt.saltutil.runner('cache.grains', | |
tgt=','.join(nodes), tgt_type='list') %} | |
{# Default version if not given at the CLI. #} |
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
/** | |
Convert an Rx4 Observable into an Rx5 Observable | |
Usage: | |
// When referenced: | |
var o4 = Rx4.Observable.interval(500).take(2).map('from 4'); | |
var o5 = Rx5.Observable.interval(500).take(2).mapTo('from 5'); | |
fromRx4(o4).concat(o5).subscribe( |
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
class Box { | |
constructor(x) { this._x = x } | |
map(f) { return new Box(f(this._x)) } | |
} | |
class LazyBox { | |
constructor(g) { this.g = g } | |
map(f) { return new LazyBox(() => f(this.g())) } | |
} |
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
/** | |
waitLatestFrom(...sources, [selector]) | |
Like withLatestFrom but waits for all sources to produce at least one value | |
before emitting. Emits immediately once it has a value for all sources. After | |
that it actively collects the latest emission from the other source observables | |
in the background and emits the latest collected values whenever the primary | |
source emits -- like withLatestFrom. | |
If the primary source completes, the other sources will be completed as well. |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
''' | |
Validate input file(s) against a Voluptuous schema | |
Pass a dash to read from stdin. | |
''' | |
from __future__ import print_function | |
import imp |
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 { TimeoutError, timer } from 'rxjs' | |
import { AjaxTimeoutError } from 'rxjs/ajax' | |
import { | |
delay, | |
filter, | |
flatMap, | |
repeatWhen, | |
retryWhen, | |
scan, | |
timeout, |