Skip to content

Instantly share code, notes, and snippets.

View boj's full-sized avatar

Brian Jones boj

View GitHub Profile
@boj
boj / keybase.md
Created April 12, 2014 01:17
Keybase Verification

Keybase proof

I hereby claim:

  • I am boj on github.
  • I am bojo (https://keybase.io/bojo) on keybase.
  • I have a public key whose fingerprint is 73A9 7668 5127 7811 DAA5 40F6 928F 77AD 6F70 5944

To claim this, I am signing this object:

package main
import (
"net/http"
)
func Call(w http.ResponseWriter, r *http.Request) {
}
{ config, pkgs, ... }:
let
hostname = "luz3";
in {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# I use VirtualBox to connect to Windows and Linux guests
@boj
boj / SgfGrammar
Created February 28, 2009 04:02
SgfGrammar
grammar SgfGrammar
rule node
'(' sp chunk* sp ')' sp {
def value
get([elements[2]])
end
def get(e)
a = []
if !e.nil?
#
# Created by Eric Lindvall <eric@sevenscale.com>
#
# WHAT: Provides a simple overview of memory allocation occuring during a
# require.
#
# NOTE: The numbers provided are of self + children, meaning the same will
# be attributed to multiple files at once.
#
# Also, memory that is no longer referenced (and would be freed) is still
class Achievement
include MongoMapper::Document
key :name, String
key :description, String
key :requirements, String
key :lang, String
end
SELECT id, username, exp, money, @prev := @curr, @curr := money, @rank := IF(@prev = @curr, @rank, @rank+1) AS rank FROM users, (SELECT @curr := null, @prev := null, @rank := 0) sel1 ORDER BY money DESC LIMIT 1;
class Watch
# Instance property
location: 'here'
# Class property
@location: 'over there'
locate: ->
alert "I am #{@location}."
@boj
boj / warcraft
Created January 5, 2011 01:00
simple script to keep you from logging out
tell application "World of Warcraft"
activate
end tell
tell application "System Events"
tell process "World of Warcraft"
repeat
set x to (random number from 1 to 2)
if x = 2 then
@boj
boj / score.rb
Created February 22, 2011 10:18
MongoMapper MapReduce Example
class Score
include MongoMapper::Document
key :user_id, ObjectId, :index => true
key :stage, String, :index => true
key :score, Integer
timestamps!
def self.high_score_map
<<-MAP