I'm writing a small Ruby library:
class FizzBuzzEndpoint
def call(env)| // data density example | |
| // shows how storing/sorting data by key can reduce I/O drastically in MongoDB | |
| // diskloc gives file # and offset of a given document, divide by 512 for block # | |
| // 2011 kcg | |
| // start clean | |
| db.disktest_noorg.drop(); | |
| db.disktest_org.drop(); | |
| // create some random data in non userid dense form |
| import pymongo | |
| import random | |
| from collections import defaultdict | |
| import time | |
| import sys | |
| from pymongo import Connection | |
| connection = Connection() | |
| connection.drop_database('test_db') | |
| collection = connection['test_db']['testing'] |
| /** | |
| * Select2 | |
| * | |
| * Renders Select2 - jQuery based replacement for select boxes | |
| * | |
| * Simply pass a 'config' object on your schema, with any options to pass into Select2. | |
| * See http://ivaynberg.github.com/select2/#documentation | |
| */ | |
| Backbone.Form.editors.Select2 = Backbone.Form.editors.Base.extend({ |