Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am bhatman on github.
* I am nmbhat (https://keybase.io/nmbhat) on keybase.
* I have a public key ASD2Pnndx4qFeBIQQLugyu6rcZsjTVqDi9h8gAX4G3et4Qo
To claim this, I am signing this object:
@bhatman
bhatman / path
Created September 29, 2015 23:16
Drop into /usr/local/bin/path, use to get the canonical path of something, profit.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
import sys
if len(sys.argv) < 2:
print os.getcwd()
sys.exit(0)
putative_path = os.path.join(os.getcwd(), sys.argv[1])
print os.path.realpath(putative_path)
#!/usr/bin/python
from multiprocessing.dummy import Pool as ThreadPool
# arbitrary. could base this on the number of cores
PARALLELISM = 5
pool = ThreadPool(PARALLELISM)
def function_to_apply(item):