Skip to content

Instantly share code, notes, and snippets.

@omwah
omwah / init_logging.py
Created August 29, 2014 04:18
Handy Python logging initialization function that sets up logging to screen and to a file
def init_logging(verbose=False, log_file=None):
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
if verbose:
level = logging.DEBUG
else:
level = logging.INFO
# Start up console handler
@omwah
omwah / gist:9926719
Created April 2, 2014 01:58
Git or Mecurial Info on Bash Prompt
# Colors to use for prompts
DARK_GREY="\e[30;1m"
LIGHT_BLUE="\e[34;1m"
RESET_COLORS="\e[0m"
# Use git completion only if git is available on system
if [ -f ~/.git-completion.bash ] && [ -f `which git` ]; then
source ~/.git-completion.bash
# Include git info in prompt
@omwah
omwah / meetup_api_responses.py
Last active January 2, 2016 22:09
Spits out the list of response keys from a meetup.com api page: http://www.meetup.com/meetup_api/docs/. Used to update meetup/python-api-client
#!/usr/bin/env python
#
# Parse out top level response names from Meetup.com API documentation
import sys
import urllib2
from BeautifulSoup import BeautifulSoup
url = sys.argv[1]