Skip to content

Instantly share code, notes, and snippets.

import pymongo
from pymongo import Connection
from bson.dbref import DBRef
from pymongo.database import Database
# connect
connection = Connection()
db = Database(connection, "things")
# clean up
#! /usr/bin/env python3
'''pyCookieCheat.py
20140518 v 2.0: Now works with Chrome's new encrypted cookies
Use your browser's cookies to make grabbing data from login-protected sites easier.
Intended for use with Python Requests http://python-requests.org
Accepts a URL from which it tries to extract a domain. If you want to force the domain,
just send it the domain you'd like to use instead.
" auto add file header
autocmd BufNewFile *.py 0r /Users/jhenxu/.vim/vim_template/vim_header_for_python
autocmd BufNewFile *.py ks|call FileName()|'s
autocmd BufNewFile *.py ks|call CreatedTime()|'s
autocmd BufNewFile *.sh 0r /Users/jhenxu/.vim/vim_template/vim_header_for_sh
autocmd BufNewFile *.sh ks|call FileName()|'s
autocmd BufNewFile *.sh ks|call CreatedTime()|'s
fun FileName()