Skip to content

Instantly share code, notes, and snippets.

@jamiely
jamiely / probability.rb
Last active December 16, 2015 23:21 — forked from nmische/probability.rb
input = "If you are self-motivated, wow, this world is tailored for you. The boundaries are all gone. But if you're not self-motivated, this world will be a challenge because the walls, ceilings and floors that protected people are also disappearing. That is what I mean when I say \"it is a 401(k) world.\" Government will do less for you. Companies will do less for you. Unions can do less for you. There will be fewer limits, but also fewer guarantees. Your specific contribution will define your specific benefits much more. Just showing up will not cut it. - T. Friedman".downcase
pair = "ou"
third = "r"
pairs = (0..input.length-2).inject({}) do |h,i|
key, val = input[i,2], input[i + 2]
h[key] = {} unless h[key]
h[key][val] = (h[key][val] || 0) + 1 if val
h
end
@jamiely
jamiely / sge.rb
Created November 25, 2011 21:09
Homebrew file for SGE (an SDL library)
require 'formula'
class Sge < Formula
url 'http://www.digitalfanatics.org/cal/sge/files/sge030809.tar.gz'
homepage 'http://www.digitalfanatics.org/cal/sge/'
md5 'a76975665b6a2bf189130fa2c8821caf'
depends_on "sdl"
depends_on "sdl_image"

MediaWiki Usage Visualization and Web Service API

First and foremost, many thanks to Brian Flad and Core Systems’ UNIX Team for configuring MediaWiki, providing tested mass import mechanisms, and setting up MySQL replication. It’s one thing to setup a service for public use -- it’s another to make it public, accessible, and usable. By skimming the recent changes page, it’s easy to see that the platform is gaining traction as several groups have started using it.

In order to show our gratitude, Jamie Ly of Learning Lab and I decided to build a web application that would visualize the recent changes page. To accomplish this several things had to happen:

  1. Populate recent changes data into a datastore independent of MediaWiki’s
  2. Make t