Skip to content

Instantly share code, notes, and snippets.

View chirgwin's full-sized avatar
🛠️
Making it work now, improving it later.

Geoff Chirgwin chirgwin

🛠️
Making it work now, improving it later.
  • San Francisco Bay Area
  • 10:51 (UTC -12:00)
View GitHub Profile
@chirgwin
chirgwin / README.md
Last active February 26, 2020 02:13 — forked from boeric/README.md
D3 Real Time Chart with Multiple Data Streams

D3 Based Real Time Chart with Multiple Streams

The real time chart is a resuable Javascript component that accepts real time data. The purpose is to show the arrival time of real time events (or lack thereof), piped to the browser (for example via Websockets). Various attributes of each event can be articulated using size, color and opacity of the object generated for the event.

The component allows multiple asynchronous data streams to be viewed, each in a horizontal band across the SVG. New data streams can be added dynamically (as they are discovered by the caller over time), simply by calling the yDomain method with the new array of data series names. The chart will automatically fit the new data series into the available space in the SVG.

The chart's time domain is moving with the passage of time. That means that any data placed in the chart eventually will age out and leave the chart. Currently, the chart history is capped at five minutes (but can be changed by modifying the comp

@chirgwin
chirgwin / build_nl2xml.sh
Last active March 16, 2016 21:19
nl2xml build and example run
#!/bin/bash
git clone https://github.com/1000milestare/nl2xml.git
cd nl2xml/
gcc -o nl2xml nl*.c
curl -O http://www.meatmachine.com/media/instructional/notelist/15_selfsame_twin.nl
./nl2xml 15_selfsame_twin.nl > 15_selfsame_twin.xml
@chirgwin
chirgwin / download_github_images.md
Last active December 21, 2015 19:26
replace Github markdown image reference (from comment) with curl command to download

find: !\[(.*)\]\((.*)\.(.*)\)

replace: curl $2.$3 > $1.$3

@chirgwin
chirgwin / square_api.html
Created October 26, 2010 14:23
This is a self-contained example of sending a payment to the iOS Square app from Mobile Safari.
<!DOCTYPE html>
<html>
<head>
<title>Square API example</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=3.0; user-scalable=0;"/>
<style type="text/css">
body