Skip to content

Instantly share code, notes, and snippets.

View jchris's full-sized avatar

Chris Anderson jchris

View GitHub Profile
Definitions.
ST = [^"]
L = [A-Za-z]
WS = ([\000-\s]|%.*)
D = [0-9]
H = [0-9a-fA-F]
Rules.
Definitions.
ST = [^"]
L = [A-Za-z]
WS = ([\000-\s]|%.*)
D = [0-9]
H = [0-9a-fA-F]
Rules.
%%% Copyright (C) 2008 Willem de Jong
%%%
%%% This is json_parser.
%%%
%%% json_parser is free software: you can redistribute it and/or modify
%%% it under the terms of the GNU Lesser General Public License as
%%% published by the Free Software Foundation, either version 3 of
%%% the License, or (at your option) any later version.
%%%
%%% json_parser is distributed in the hope that it will be useful,
{
"mentions": [{
"id": "http:\/\/www.notontheguestlist.com\/blog\/2007\/07\/index.html|f0f79a28c6326575fe8ac51f7faaad91",
"value": {
"a": "\"Hard Smart Beta\"",
"title": "Not on the Guest List:",
"date": "2008\/07\/01 14:28:15 +0000",
"url": "http:\/\/www.notontheguestlist.com\/blog\/2007\/07\/index.html",
"excerpt": " The last song was my favorite of the set because that's when I left the sweaty confines of the crowd and made my way to the back where it was just a degree cooler and there was more space so I could dance it out. \"Hard Smart Beta\" Starfucker MP3 After that, I made my way out in a search for air and water. While I didn't find any water, I did find ice cubes in a freezer decorated with a polaroid of Dhani Rosa. "
},
-module(mergesort).
-export([sort/1]).
% Usage:
% c(mergesort).
%
% mergesort:sort([2,7,55,4,30,6,7,99,1,100]).
% => [1,2,4,6,7,7,30,55,99,100]
sort([]) -> [];
sudo gem install defunkt-github -s http://gems.github.com
Password:
Successfully installed defunkt-github-0.1.3
1 gem installed
Installing ri documentation for defunkt-github-0.1.3...
Installing RDoc documentation for defunkt-github-0.1.3...
brindle 15:53:52 ~/code/slipcover(master) jchris $github pull atduskgreg
/usr/bin/github:19:in `load': no such file to load -- github (LoadError)
from /usr/bin/github:19
@jchris
jchris / post.rb
Created September 30, 2008 16:42
class Question < CouchRest::Model
key_accessor :q, :a
end
class Person < CouchRest::Model
key_accessor :name
def last_name
name.last
end
end
class Question
include CouchRest::Model
key_accessors :type, :position, :text, :required_answers_count, :possible_answers, :hint
def initialize (node = {})
@doc = node
end
def to_json
diff --git a/trunk/share/server/test.js b/trunk/share/server/test.js
new file mode 100644
index 0000000..90cc010
--- /dev/null
+++ b/trunk/share/server/test.js
@@ -0,0 +1,2181 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy
+// of the License at
+//
require 'rubygems'
require 'json'
require 'open-uri'
scores = JSON.parse(open('http://spreadsheets.google.com/feeds/list/pVNrsh7EqwD6HkFTmS3v9aw/od6/public/values?alt=json').read); nil
# scores['feed']['entry'].length
newscores = {}
scores['feed']['entry'].each do |e|