Skip to content

Instantly share code, notes, and snippets.

?date=date:2010
---------------
[ { name: 'eq'
, args: [ 'date', Thu, 01 Jan 1970 00:00:02 GMT ]
}
]
?date=date:2010-05
---------------
diff --git a/lib/mongodb/bson/bson.js b/lib/mongodb/bson/bson.js
index 4194f5e..bf9094a 100644
--- a/lib/mongodb/bson/bson.js
+++ b/lib/mongodb/bson/bson.js
@@ -214,7 +214,7 @@ BSON.deserialize = function(data, is_array_item, returnData, returnArray) {
// Read the oid (12 bytes)
var oid = data.substr(index, 12);
// Calculate date with miliseconds
- var value = new exports.ObjectID(oid);
+ var value = ObjectID.createPk(oid);
@dvv
dvv / fixture for perstore
Created May 20, 2010 18:41
fixture for perstore
/**
* http://develobert.blogspot.com/2007/11/automated-lorem-ipsum-generator.html
*/
LoremIpsum = {
fullstop: '.', /* Character(s) to add to the end of sentences */
min_wps: 10, /* Minimum words per sentence */
max_wps: 25, /* Maximum words per sentence */
min_spp: 2, /* Minimum sentences per paragraph */
max_spp: 8, /* Maximum sentences per paragraph */
exports.Query = function(seed, params){
if (typeof seed === 'string')
return exports.parseQuery(seed, params);
var q = new Query();
if (seed && seed.name && seed.args)
q.name = seed.name, q.args = seed.args;
return q;
};
middleware capable (not true so far :) of gzipping Buffers:
=======================================
function dir(x){var sys=require('sys');sys.debug(sys.inspect(x));}
exports.Compress = function(nextApp){
return function(request){
var encoding = 'gzip';
if ((request.headers['accept-encoding']||'').indexOf(encoding) >= 0) {
//dir('gzipping');
// so far only node.js provides compression module
var Gzip = require('compress').Gzip;
static void genericHgetallCommand(redisClient *c, int flags) {
robj *o, *lenobj, *obj;
unsigned long count = 0;
hashIterator *hi;
lenobj = createObject(REDIS_STRING,NULL);
addReply(c,lenobj);
decrRefCount(lenobj);
for (int i = 1; i < c->argc; ++i) {
Given:
=====
unconstrained querystring (Q),
zero or more chainable slices (S) to be applied on Q,
Range: items=A,B (R)
Task:
=====
determine:
"skip" (offset from start of Q),
APACHE SIMPLE REDIRECT:
======================
Server Hostname: test.archonsoftware.com
Server Port: 80
Document Path: /load-test/index.php
Document Length: 0 bytes
Concurrency Level: 1000
/**
* This is a staring point for an application written on Pintura
*/
function dir(){var sys=require('sys');for(var i=0,l=arguments.length;i<l;i++)sys.debug(sys.inspect(arguments[i]));}
function apply(o, c, defaults){
if (defaults) {
apply(o, defaults);
}
#
# This is a staring point for an application written on Pintura
#
# useful helpers
h: require('./util')
Facet: require 'perstore/facet'
#Store: require('perstore/store/persistent-memory').PersistentMemory
Store: require('perstore/store/mongodb').MongoDB