Skip to content

Instantly share code, notes, and snippets.

@erh
erh / README.md
Last active January 23, 2018 11:33
sample aggregation stage module - inject

This is a sample aggregation stage that insert a field into every document.

Steps:

  1. Git clone the mongodb source code.
  2. Create a directory called 'modules' in src/mongo/db/modules.
  3. Git clone this repo as src/mongo/db/modules/inject
  4. Build MongoDB
  5. Now try the new aggregation stage:
@erh
erh / histogram.py
Last active July 31, 2021 06:46
This is a very simple python program that reads your email inbox and generates a histogram of how much email is unread in your inbox.
#/usr/bin/env python
###
### This generates a very simple histogram of unread e-mail in your INBOX.
### This is meant as a toy, and your are free to do whatever you want with the code.
###
# core python libraries
import datetime