Skip to content

Instantly share code, notes, and snippets.

import {run} from '@cycle/run';
import {makeCanvasDriver, rect, text} from 'cycle-canvas';
import { makeKeyboardDriver } from 'cycle-keyboard'
import xs from 'xstream'
import fromEvent from 'xstream/extra/fromEvent'
import split from 'xstream/extra/split'
import throttle from 'xstream/extra/throttle'
import concat from 'xstream/extra/concat'

The rabbitholes never end!

  • TOC {: toc }

Artist-Centric Programming Tools

Friday night, Twitter sent me a notification to look at this tweet:

https://t.co/nqIwhoOc39Recording of our presentation on Artist-Centric Programming Tools at #chi2018— Jennifer Jacobs (@jsquare) May 18, 2018

Friday 6/1/18

  • TOC

{: toc }

group = xs => xs.reduce((rv, x) => {
(rv[x] = (rv[x] || [])).push(x);
return rv;
},
{});
objMap = (oldObj, func) => Object.keys(oldObj).reduce(function(newObj, current) {
newObj[current] = func(oldObj[current])
return newObj;
},
{});
_nonWordRe = /[^a-zA-Z0-9\u00C0-\u00FF, ]+/g;
_iterateGrams = function(value, gramSize) {
gramSize = gramSize || 2;
var simplified = '-' + value.toLowerCase().replace(_nonWordRe, '') + '-',
lenDiff = gramSize - simplified.length,
results = [];
if (lenDiff > 0) {
for (var i = 0; i < lenDiff; ++i) {
value += '-';
}
count = 0

update msg count =
  case msg of
    Increment ->
      count + 1
clickEvents <- intButton clicksCount
clicksCount <- foldDyn (\accumulator currentValue -> accumulator + 1) 0 clickEvents
-- model
count = 0
--reducer
update msg count =
case msg of
Increment ->
count + 1
-- view