Skip to content

Instantly share code, notes, and snippets.

View brendon-codes's full-sized avatar

Brendon brendon-codes

View GitHub Profile
@brendon-codes
brendon-codes / gist:4035512
Created November 8, 2012 00:05
Updates API Response
{
'display_type_id': 5,
display_type_name: 'pulse',
data : [
{
id: 1,
body: 'Hey <a href="/brad.whitcomb/">Brad Whitcomb</a>, how are you?',
created: '2012-11-02T04:19:19.327122+00:00',
modified: '2012-11-02T04:19:19.327122+00:00',
user: {
@brendon-codes
brendon-codes / redislogger.py
Created August 1, 2011 06:03 — forked from droot/redislogger.py
Redis Log Handler in Python
import redis
import logging
class RedisLogHandler:
"""Log handler for logging logs in some redis list
"""
def __init__(self, host = None, port = None, db = 0, log_key = 'log_key'):
self._formatter = logging.Formatter()
self._redis = redis.Redis(host = host or 'localhost', port = port or 6379, db = db)
self._redis_list_key = log_key