Skip to content

Instantly share code, notes, and snippets.

Lenses

My attempt to understand and create functional lenses in javascript. There are some laws and de facto standards

  • get after set should return the modified part
  • set after get should return the unmodified whole
  • set after set should overwrite the part
  • create should take a getter and a setter
  • lenses should be left to right composable
  • there should be a view, set and over functions to work with lenses
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=RobotoDraft:300,400,500,700,400italic">
</head>
<body>
<div class="card">
@rikkertkoppes
rikkertkoppes / input.xml
Created May 20, 2015 06:36
data thing xml example
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
@rikkertkoppes
rikkertkoppes / input.json
Created May 20, 2015 06:03
Test for data thing
[
{
"_id": "5527dfcebd519b4db144e1e3",
"index": 0,
"guid": "4e814f3e-2caa-45a7-bb30-87643bf3f4a1",
"isActive": false,
"balance": "$2,730.86",
"picture": "http://placehold.it/32x32",
"age": 24,
"eyeColor": "blue",
@rikkertkoppes
rikkertkoppes / custom.css
Last active August 29, 2015 14:19
displaySystems custom css
/* custom lower third background */
div#lowThird {
background-color: green;
}
@rikkertkoppes
rikkertkoppes / Agenda
Last active August 29, 2015 14:01
FLL Scoring meeting
FLL Scoring catchup meeting 16-05-2014
- Status Quo door Rikkert
- https://github.com/FirstLegoLeague/fllscoring
- runs on phones, web and desktop
- team selection, rough scoring and ranking done
- needs work on initial communication, design and export
- https://github.com/FirstLegoLeague/fllscoring/issues?milestone=1&page=1&state=open
- Ervaringen Rob in Slovenie
- Toekomstvisie van Kenny
@rikkertkoppes
rikkertkoppes / gist:9048717
Last active August 29, 2015 13:56
Problem statement horse tracking

Problem statement

Primary goal: tracking (the position of) a horse and rider in a 20x40m arena. Secondary goal: capture useful video for the general audience

Camera's can only be positioned inside the arena. To cover everything, I need multiple cameras.

Option 1: Static cameras with relatively high fov (at least 2). Use motion tracking software like to detect. Candiates to be explored: vvvv, processing (jmyron), eyesweb, eyecon. Coordinates can be broadcasted via osc or something similar.

@rikkertkoppes
rikkertkoppes / configurator.md
Created December 13, 2013 12:11
Short term configuration management

Rationale

For short term systems, such as used in events (like the FIRST LEGO League). Getting instances of software to run and configured is a relatively large task. As components are deployed on new servers, web addresses change and hence configuration needs to be adjusted to the new reality.

One way to solve this is to create and maintain permanent configurations, but that does not scale when the configuration needs to change based on need, infrastructure and available resources.

Example