Skip to content

Instantly share code, notes, and snippets.

@danohu
danohu / _.md
Last active August 12, 2016 14:58
test
@danohu
danohu / _.md
Created August 12, 2016 14:51
test
@danohu
danohu / splitjson.py
Last active January 4, 2016 16:48
split large mongodumps into files usable for import
#!/usr/bin/env python
from itertools import izip_longest
import json
import subprocess
import sys
def grouper(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return izip_longest(fillvalue=fillvalue, *args)