Skip to content

Instantly share code, notes, and snippets.

Ward Cunningham WardCunningham

Block or report user

Report or block WardCunningham

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@WardCunningham
WardCunningham / README.md
Last active Mar 30, 2017
Radial Organization Chart
View README.md

Hover shows employee details, dims more recent hires, and tallies office distribution of similarly senior staff. Adapted from Radial Tidy Tree by M. Bostock. block

View mkplugin.md
@WardCunningham
WardCunningham / .gitignore
Last active Aug 29, 2015
Federation Scraper
View .gitignore
logs
sites
.DS_Store
*.numbers
@WardCunningham
WardCunningham / mkbackup.sh
Created Mar 22, 2015
rotating backup of federated wiki site
View mkbackup.sh
# save a daily backup with a retention of one week
# usage: sh mkbackup.sh forage.ward.fed.wiki.org
site=$1
day=`date +%a`
curl -s http://$site/system/export.json \
> backups/$site.$day.export.json
@WardCunningham
WardCunningham / roster.rb
Last active Aug 29, 2015
Recent Changes by Roster
View roster.rb
# create page of conversatons
# cron: */5 * * * * (cd wiki/farm-8080/client; CSV='...' ruby roster.rb)
# deploy: scp roster.rb fed.wiki.org:wiki/farm-8080/client/
require 'rubygems'
require 'json'
require 'csv'
require 'pp'
@WardCunningham
WardCunningham / trending.rb
Created Dec 23, 2014
Script for Conversation Clubs
View trending.rb
@WardCunningham
WardCunningham / cloneAll.sh
Last active Aug 29, 2015
Clone and Search all FedWiki Plugins
View cloneAll.sh
# make a fresh clone of all plugin repos
rm -rf all
mkdir all
for i in `sh listPlugins.sh`
do (cd all; git clone git@github.com:fedwiki/$i.git)&
done
@WardCunningham
WardCunningham / utime.rb
Created Oct 21, 2014
Restore dates lost copying wiki pages
View utime.rb
# This script reads all pages in a repository and sets each file's last modification date
# based on dates found in the Journal.
require 'json'
early = 1335324580000
Dir.glob('../pages/*') do |path|
File.open(path) do |file|
page = JSON.parse file.read
epoch = page['journal'].last['date'] || early
@WardCunningham
WardCunningham / FloatPrecisionTest.cc
Last active Aug 29, 2015
Reliable Representation of Integers in Floats
View FloatPrecisionTest.cc
#include <iostream>
int main() {
int n = 0;
for (long w=1; w<=10000000000000L; w*=10) {
int k = 0;
for (int i=0; i<1000000; i++) {
long p = (long)(rand()%w);
long q = (float) p;
if (p != q) k++;
@WardCunningham
WardCunningham / mkplugin.sh
Last active Jan 22, 2017
Script to create a stub plugin with stub documentation
View mkplugin.sh
#!/bin/sh
# Script to create a stub plugin with build script, tests and documentation.
# See http://plugins.fed.wiki.org/make-plugin-script.html
# Usage: ./mkplugin.sh CoolThing
if [ $# -eq 0 ]
then
echo "Usage: ./mkplugin.sh <new-plugin-name>"
You can’t perform that action at this time.