Skip to content

Instantly share code, notes, and snippets.

View rh0dium's full-sized avatar

Steven rh0dium

View GitHub Profile
class ColorizingStreamHandler(logging.StreamHandler):
"""
A stream handler which supports colorizing of console streams
under Windows, Linux and Mac OS X.
:param strm: The stream to colorize - typically ``sys.stdout``
or ``sys.stderr``.
"""
# color names to indices
@rh0dium
rh0dium / settings_logging.py
Last active August 17, 2020 21:16
Color logging inside of PyCharm
# Get and install logutils
# pip install logutils
# === settings.py ===
class PseudoTTY(object):
"""This allows a a fake tty which will allow PyCharm to always say its a tty"""
def __init__(self, underlying):
"""Define my underlying class"""
@rh0dium
rh0dium / fabfile.py
Created February 7, 2013 13:17
fabric file logging
log = logging.getLogger(__name__)
django.settings_module('settings')
from django.conf import settings
# Turn down logging..
l = logging.getLogger("ssh")
l.setLevel(logging.ERROR)
@rh0dium
rh0dium / logger.py
Created January 26, 2013 16:14
Adds a colorizing stream handler..
# -*- coding: utf-8 -*-
"""logging.py: Django www"""
import ctypes
import logging
import platform
import os
__author__ = 'Steven Klass'
__date__ = '2/24/12 10:20 PM'

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

@rh0dium
rh0dium / fabfile.py
Created October 31, 2011 21:32 — forked from onyxfish/fabfile.py
Pivotal Energy
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"