THIS PAGE IS UNMAINTAINED. You probably want https://github.com/RedBeard0531/mongo_module_ninja#-icecream-support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> db.foo.ensureIndex({a:1}) | |
> db.foo.ensureIndex({b:1}) | |
> db.foo.insert({a:1}) | |
> db.foo.insert({b:1}) | |
> db.foo.insert({a:1, b:1}) | |
> db.foo.find({$or:[{a:1}, {b:1}]}).explain() | |
{ | |
"clauses" : [ | |
{ | |
"cursor" : "BtreeCursor a_1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from pymongo import Connection | |
import subprocess | |
import sys | |
def advance(cur) | |
try: | |
return cur.next() | |
except StopIteration: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ convert - /tmp/o.png << EOF | |
P1 | |
# This is an example bitmap of the letter "J" | |
6 10 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 | |
0 0 0 0 1 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** A generic non-owning pointer type for function arguments. | |
* It will convert from any pointer type except auto_ptr. | |
* Semantics are the same as passing the pointer returned from get() | |
* const ptr<T> => T * const | |
* ptr<const T> => T const * or const T* | |
*/ | |
template <typename T> | |
struct ptr { | |
ptr() : _p(NULL) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example Query | |
db.runCommand({aggregate:'zips', | |
explain:true, | |
pipeline: [ | |
{$group: {_id:'$state', totalPop: {$sum:'$pop'}}}, | |
{$sort: {totalPop:1}}, | |
{$limit:10}]}) | |
// Unsharded: | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <type_traits> | |
/** | |
* Test that 'Code' fails to compile. | |
* 'Type' is aliased to 'Alias' and it must be used in 'Code' | |
*/ | |
#define COMPILE_FAIL_TEST(Name, Type, Alias, Code) \ | |
struct Name { \ | |
template <typename Alias> \ | |
static auto compiles(Alias && ) -> decltype((void)(Code), std::true_type()); \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Compact Waterfall Summary | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Make it Smaller | |
// @author Mathias Stearn | |
// @match https://evergreen.mongodb.com/waterfall/* | |
// @grant none | |
// ==/UserScript== | |
// vim: sts=2 sw=2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Show Failures by Test | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://evergreen.mongodb.com/version/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tables | |
import critbits | |
import os | |
import sequtils | |
import times | |
import random | |
import xxhash | |
#import murmur | |
import murmur3 | |
import hashes |