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
This script will create stub files and build scripts for a federated wiki plugin.
./mkplugin.sh CoolThing
to make a CoolThing plugin. Learn more at plugins.fed.wiki.org.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logs | |
sites | |
.DS_Store | |
*.numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create page of conversatons | |
# cron: */5 * * * * (cd wiki/farm-8080/client; ruby trending.rb) | |
# deploy: scp trending.rb fed.wiki.org:wiki/farm-8080/client/ | |
require 'rubygems' | |
require 'json' | |
require 'pp' | |
def fetch endpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make a fresh clone of all plugin repos | |
rm -rf all | |
mkdir all | |
for i in `sh listPlugins.sh` | |
do (cd all; git clone [email protected]:fedwiki/$i.git)& | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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>" |
NewerOlder