Skip to content

Instantly share code, notes, and snippets.

View WardCunningham's full-sized avatar

Ward Cunningham WardCunningham

  • Cunningham & Cunningham, Inc.
  • Portland, Oregon
View GitHub Profile
@WardCunningham
WardCunningham / cross-ref.coffee
Created January 5, 2014 19:43
Visualize the possible flows of variables within Method plugins in a Federated Wiki site.
# scan all methods of all pages for variables
# create a graphviz dot file maping cross-references
# scp -r fed.wiki.org:farm/mehaffy.fed.wiki.org/pages pages
# coffee cross-ref.coffee
# graphviz cross-ref.dot
fs = require 'fs'
@WardCunningham
WardCunningham / gist:8265495
Created January 5, 2014 07:30
Squeeze a federated wiki page by replacing a huge image with a smaller copy
# replace an image with a much smaller one
# work in localhost, then post with scp
# scp pages/degrees-of-publicness fed.wiki.org:wiki/farm-8080/data/farm/mehaffy.fed.wiki.org/pages/
fs = require 'fs'
destFileName = '../pages/degrees-of-publicness'
# find source image
source = JSON.parse fs.readFileSync '../pages/scratch', 'utf-8'
images = (item for item in source.story when item.type is 'image')
@WardCunningham
WardCunningham / ReadMe.md
Last active December 19, 2015 05:29
Crossword

Wiki appears as a word in the New York Times crossword on June 30, 2013. Thanks to David DiNucci for bringing this to my attention and to Bill Butler for posting the puzzle with explanation.

See also my correspondence on the etymology of wiki.

@WardCunningham
WardCunningham / ReadMe.md
Last active December 19, 2015 03:59
Push Pins

We simulate push-pins marking locations on a map. We use Force layout to position the pins as close to where they belong as possible. This may not be very close in geographic terms. However, the energy minimizing placement looks sensible on maps of large regions with densely clustered locations.

@WardCunningham
WardCunningham / ReadMe.md
Last active September 25, 2016 17:56 — forked from mbostock/.block
Web Traffic

We start with Bostock's Multi-Foci Force Layout example and add motion to represent traffic progressing through a system. Think of this as progress bars for every inflight transaction.

Each dot represents a transaction read from a four-minute long recording. Watch for a spike in activity at 20:20 after the hour. The animation repeats when finished.

Dots enter when transactions start and exit when completed. Their speed is proportional to client's response time while their size reflects the server's contribution to total time. Color comes from the specific request.

// Copyright (c) 2003 Cunningham & Cunningham, Inc.
// Read license.txt in this directory.
package Code;
public class Code {
static protected StringBuffer emited;
public void run (State s) {};