Skip to content

Instantly share code, notes, and snippets.


André Staltz staltz

View GitHub Profile

Keybase proof

I hereby claim:

  • I am staltz on github.
  • I am andrestaltz ( on keybase.
  • I have a public key whose fingerprint is C83A 1721 7B3E 3DE2 23F2 F4C6 A1F0 0911 A32F D4DD

To claim this, I am signing this object:

staltz / streamio.js
Created Oct 3, 2016
Playful Haskell Stream I/O with ES6 Generators
View streamio.js
function *main() {
const confirmRequest = {
type: 'confirm',
value: 'Are you sure?',
const confirmResponse = yield confirmRequest;
if (confirmResponse === true) {
const consoleRequest = {
type: 'console',
staltz / main.js
Created Jun 22, 2016
A-Frame + Cycle.js demo
View main.js
import xs from 'xstream';
import Cycle from '@cycle/xstream-run';
import {h, makeDOMDriver} from '@cycle/dom';
function main(sources) {
let vdom$ = xs.periodic(16).startWith(0).map(i =>
h('a-scene', [
h('a-sphere', {
attrs: {
staltz / helper.js
Created Jun 6, 2016
How to use Stanga ( as a wrapper, not as a driver
View helper.js
// Generic helper function that takes a main() (the top-level component)
// and wraps it with Stanga logic
function wrapWithStanga(main, initialState) {
return function (sources) {
const modProxy$ = new Subject();
const modelSource = Model(initialState)(modProxy$);
sources.model = modelSource;
const sinks = main(sources);
staltz /
Last active Oct 26, 2017
How to debug Mocha tests written in Babel, running only in Node.js

Run this in one shell

./node_modules/.bin/mocha --debug-brk --compilers js:babel-register test/node

Then this in another shell


Then open the browser

staltz / check-operators.js
Last active Feb 7, 2017
A node.js script to check how often are RxJS operators used
View check-operators.js
var operators = [
staltz / main.js
Created Mar 4, 2016
Cycle.js demo with MIDI and Web Audio
View main.js
import {Observable, Disposable} from 'rx';
import {run} from '@cycle/core'
const jsondiffpatch = require('jsondiffpatch').create({
objectHash: function(obj) {
function generateCurve(steps){
var curve = new Float32Array(steps)
staltz /
Created Mar 3, 2016
Cycle.js example in CoffeeScript
{run} = require '@cycle/core'
{Observable} = require 'rx'
{div, input, h2, makeDOMDriver} = require '@cycle/dom'
intent = (domSource) =>
changeWeight$ = domSource
.map((ev) =>
changeHeight$ = domSource
staltz / first.js
Created Dec 10, 2015
Tiny Cycle.js 0
View first.js
Rx.Observable.timer(0, 1000)
.map(i => `Seconds elapsed ${i}`)
.subscribe(text => {
const container = document.querySelector('#app');
container.textContent = text;
View tiny-cycle-2.js
function main() {
return {
DOM: Rx.Observable.timer(0, 1000)
.map(i => {
return {
tagName: 'h1',
children: [`Seconds elapsed ${i}`]
You can’t perform that action at this time.