Skip to content

Instantly share code, notes, and snippets.

View kchodorow's full-sized avatar

Kristina kchodorow

View GitHub Profile
@kchodorow
kchodorow / gist:3626251
Created September 4, 2012 20:44 — forked from anonymous/gist:3610610
Informadiko Sample Schema
#!/usr/bin/mongo informadiko
// ┏━┓┏━╸┏━╸┏━┓╻ ╻┏┓╻╺┳╸┏━┓
// ┣━┫┃ ┃ ┃ ┃┃ ┃┃┗┫ ┃ ┗━┓
// ╹ ╹┗━╸┗━╸┗━┛┗━┛╹ ╹ ╹ ┗━┛
db.dropDatabase() // BE CAREFUL
//db.createCollection("system.profile", {capped:true, size:1024000000}) // 1024 Megs
db.setProfilingLevel(2);
@kchodorow
kchodorow / other.h
Created April 20, 2011 19:59
tester.cpp
#include <stdio.h>
#include "other.h"
#include "tester.h"
namespace other {
void other_type::some_method() {
printf("here\n");
}
}
<?php
function getReplicationInfo($m) {
$db = $m->local;
$result = array();
$ol = $db->system->namespaces->findOne(array("name" => 'local.oplog.$main'));
if ($ol && array_key_exists('options', $ol)) {
$result['logSizeMB'] = $ol['options']['size'] / 1000 / 1000;
<?php
// inserts 1,000,000 docs in 14 seconds on a MacBook Pro running Ubuntu 9.04
class Timer
{
var $start;
var $pause_time;
/* start the timer */