Skip to content

Instantly share code, notes, and snippets.

View kayakjang's full-sized avatar

Kayak Jang kayakjang

  • Beijing Chinese
View GitHub Profile
@kayakjang
kayakjang / gist:1750926
Created February 6, 2012 09:02
Memory usage for MongoMapper' where query
# load_test_books.rb
require 'rubygems'
require 'mongo_mapper'
MongoMapper.connection = Mongo::Connection.new('127.0.0.1', 27017)
MongoMapper.database = 'dpu-test'
class Book
include MongoMapper::Document
@kayakjang
kayakjang / dnsd.rb
Created December 9, 2011 01:37 — forked from peterc/dnsd.rb
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL