I hereby claim:
- I am ivangonekrazy on github.
- I am IvanTam (https://keybase.io/IvanTam) on keybase.
- I have a public key whose fingerprint is 92A4 A414 9C77 BEC7 2097 97BC F46D 97C8 44F0 5D8E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Last login: Fri Aug 22 16:51:51 on ttys000 | |
Traphaus:~ ivan$ nslookup community.loggly.com | |
Server: 8.8.8.8 | |
Address: 8.8.8.8#53 | |
Non-authoritative answer: | |
community.loggly.com canonical name = loggly-haproxy-1333703238.us-west-2.elb.amazonaws.com. | |
Name: loggly-haproxy-1333703238.us-west-2.elb.amazonaws.com | |
Address: 54.201.53.220 | |
Name: loggly-haproxy-1333703238.us-west-2.elb.amazonaws.com |
import logging | |
# Get the top-level logger object | |
log = logging.getLogger() | |
# make it print to the console. | |
console = logging.StreamHandler() | |
log.addHandler(console) | |
# emit a warning to the puny Humans |
import logging | |
log = logging.getLogger() # 'root' Logger | |
console = logging.StreamHandler() | |
format_str = '%(asctime)s\t%(levelname)s -- %(processName)s %(filename)s:%(lineno)s -- %(message)s' | |
console.setFormatter(logging.Formatter(format_str)) | |
log.addHandler(console) # prints to console. |
import logging | |
log = logging.getLogger() | |
# Set a severity threshold to one above WARN | |
log.setLevel(logging.ERROR) | |
# This WARNING will not reach the Humans. | |
log.warn('Citizens of Earth, be warned!') | |
# This CRITICAL message, however, will not be ignored. |
import logging import logging.config | |
LOGGING_CONFIG = { | |
'version': 1, # required | |
'disable_existing_loggers': True, # this config overrides all other loggers | |
'formatters': { | |
'simple': { | |
'format': '%(asctime)s %(levelname)s -- %(message)s' | |
}, | |
'whenAndWhere': { |
import re | |
from collections import defaultdict | |
SHORT_WORD_LEN = 4 | |
WORD_REGEX = '\w+' | |
TEXT_FILE_PATH = 'text.txt' | |
word_counter = defaultdict(int) | |
# read in all the words, cull out the ones that aren't long enough |
import inspect | |
def collect_frame_contexts(attr='__frame__', start_depth=1, **immediatecontext): | |
""" | |
Bubbles up the call stack, accumulating | |
__frame__ context dicts. | |
""" | |
contexts = [] | |
frames = inspect.getouterframes( inspect.currentframe() ) |
// Draw pie charts | |
var charts = []; | |
function createPie(statsjson, type, div, title) { | |
if(document.getElementById(div)){ | |
data = createDataArray(statsjson, type, title, 'reg'); | |
if(data.getNumberOfRows() > maxResults){ | |
data.removeRows(maxResults, 999999) | |
} |
from django.http import HttpResponse | |
from piston.resource import Resource | |
from piston.handler import AnonymousBaseHandler, BaseHandler | |
class CORSResource(Resource): | |
""" | |
Piston Resource to enable CORS. | |
""" | |
# headers sent in all responses |