Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
from django.db.models.signals import post_init | |
def track_data(*fields): | |
""" | |
Tracks property changes on a model instance. | |
The changed list of properties is refreshed on model initialization | |
and save. | |
>>> @track_data('name') |
import logging | |
from math import exp | |
from random import random | |
from time import sleep | |
from time import time | |
from uuid import uuid1 | |
from redis.exceptions import WatchError |
# create a dummy heroku app | |
heroku create --stack cedar | |
# add sentry | |
heroku addons:add sentry | |
# fetch your config | |
heroku config | grep SENTRY_DSN | |
# configure your application via http://getsentry.com/guide/ |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
import heapq | |
from threading import Lock | |
class HeapQueue(object): | |
def __init__(self, values=None, maxsize=None, reversed=False): | |
""" | |
Create a new heap queue. | |
- ``maxsize`` will create a capped queue. |
""" | |
cramermath | |
~~~~~~~~~~ | |
Usage: | |
>>> import cramermath | |
>>> cramermath.log(10) | |
0.014728067495500818 | |
""" |
When an update comes into the system we fire off something like the following: | |
>>> app.buffer.incr( | |
>>> Group, # model class, | |
>>> {'times_seen': 1}, # counters | |
>>> {'id': group.id}, # filter restrictions, sometimes a composite key | |
>>> {'last_seen': now}, # metadata to update when buffer is processed | |
>>> ) | |
This would get stored in a hash key as following: |
Questions to answer:
.DS_Store | |
tmp/ |