Skip to content

Instantly share code, notes, and snippets.

View rueckstiess's full-sized avatar

Thomas Rückstieß rueckstiess

View GitHub Profile
@rueckstiess
rueckstiess / polymorphic.test.js
Created June 26, 2015 06:15
tests for ampersand-collection-filterable with polymorphic collections
var assert = require('assert'),
collectionFilterable = require('../ampersand-collection-filterable'),
AmpersandCollection = require('ampersand-collection'),
AmpersandState = require('ampersand-state');
var Candy = AmpersandState.extend({
props: {
id: 'number',
name: 'string'
}
@rueckstiess
rueckstiess / int-21-admission-guide-structure.md
Created March 12, 2015 01:47
mongodb-js admission structure
# Admission Guidelines for contributions to mongodb-js

## Organization Toolchain

- explain mongodb-js setup  

## All repositories
  • requirements: you MUST follow these steps
@rueckstiess
rueckstiess / index.jade
Last active August 29, 2015 14:13
the-query-bar
h5 single clause
.query
.clause
.key foo
.value bar
h5 multiple clauses (implicit $and)
.query
.clause
.key foo

Keybase proof

I hereby claim:

  • I am rueckstiess on github.
  • I am tomonezero (https://keybase.io/tomonezero) on keybase.
  • I have a public key whose fingerprint is 6F50 5374 7A87 2B54 6C32 6DC3 8DD2 1CF0 E6CA EE3B

To claim this, I am signing this object:

@rueckstiess
rueckstiess / gist:9927111
Created April 2, 2014 02:42
Log2Code schema
> db.instances.findOne()
{
"_id" : 0,
"matches" : [
{
"loglevel" : null,
"trigger" : " log(",
"version" : "r2.4.5",
"lineno" : 63,
"file" : "src/mongo/bson/bson_db.h"
@rueckstiess
rueckstiess / log2code_example.py
Created April 2, 2014 02:26
Example of mtools' Log2CodeConverter
from mtools.util.log2code import Log2CodeConverter
l2cc = Log2CodeConverter()
match, _ = l2cc("Mon Oct 7 13:25:15.613 [FileAllocator] done allocating datafile /data/mongodb/db/local.0, size: 64MB, took 0.522 secs")
print match.pattern
print match.matches['r2.4.8']
@rueckstiess
rueckstiess / repro_shorter.js
Created April 1, 2014 23:07
SERVER-12638 repro.js (shorter)
var clusterConfig = { shards : 3,
mongos : 3,
config : 1 };
var st = new ShardingTest(clusterConfig);
var mongos = st.s;
function createShardedCollections(collName, dbName, mongosHost) {
var mongos = new Mongo(mongosHost);
var i = 0;
@rueckstiess
rueckstiess / mloginfo_queries.txt
Created February 14, 2014 00:53
demo of mloginfo --queries
$ mloginfo mongod_noprefix.log --queries
source: mongod_noprefix.log
start: 2014 Apr 05 06:39:57
end: 2014 Apr 06 06:27:07
date format: ctime-pre2.4
length: 58224
binary: mongod
version: 2.2.3
@rueckstiess
rueckstiess / oplogsize.patch
Created February 11, 2014 05:27
oplogsize patch for mlaunch tests to run on linux.
diff --git mtools/mlaunch/mlaunch.py mtools/mlaunch/mlaunch.py
index 40b7057..89cc05d 100755
--- mtools/mlaunch/mlaunch.py
+++ mtools/mlaunch/mlaunch.py
@@ -1168,7 +1168,7 @@ class MLaunchTool(BaseCmdLineTool):
key_path = os.path.abspath(os.path.join(self.dir, 'keyfile'))
auth_param = '--keyFile %s'%key_path
- if self.unknown_args:
+ if self.unknown_args and extra != '--configsvr':
@rueckstiess
rueckstiess / load.py
Created June 27, 2013 14:47
SERVER-9986
from pymongo import MongoClient
import random
mc = MongoClient()
batch = []
for i in xrange(10000000):
doc = {"location": [random.random(), random.random()], "name": {"firstName": random.choice(["tom","david","james","stephen","ian","tia","andre"])},"taxonomy":{"code": str(random.randint(0, 10000))}}
if i % 10000 == 9999: