I hereby claim:
- I am swilcox on github.
- I am swilcox (https://keybase.io/swilcox) on keybase.
- I have a public key ASDJNfDD2K1ItGxE_HCRahKR18ZBhB-XiPhzWiFY810n5Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
""" | |
Shamelessly lifted from https://github.com/sebest/json-logging-py in order | |
to simplify customization. | |
""" | |
import os | |
from datetime import datetime | |
import json | |
import logging | |
import socket |
import redis | |
import mockredis | |
from django.conf import settings | |
from django.core.signals import request_finished | |
try: | |
from eventlet.corolocal import local | |
except ImportError: | |
from threading import local |
require 'formula' | |
class Libstemmer < Formula | |
# upstream is constantly changing the tarball, | |
# so doing checksum verification here would require | |
# constant, rapid updates to this formula. | |
head 'http://snowball.tartarus.org/dist/libstemmer_c.tgz' | |
homepage 'http://snowball.tartarus.org/' | |
end |
import math | |
def distance(origin, destination): | |
#assumes origin and destination are (lat, long) pairs where lat and long are decimals | |
lat1, lon1 = origin | |
lat2, lon2 = destination | |
#radius = 6371 # km <-- use this if metric | |
radius = 3961 # miles <-- use this if english / miles | |
dlat = math.radians(lat2-lat1) | |
dlon = math.radians(lon2-lon1) |
Multi-graph widget for Shopify's dashing to display a comparison style graph (or stacked with a minor modification). Obviously, this is an example that is built heavily on the existing graph widget that is provided with dashing. This widget provides a more clear framework for expanding the graph for multiple series (or nodes) of data. After seeing the example code, it should be fairly easy to expand to 3 or more overlaid graphs (although colors might get tricky). And really, this is just a slightly greater use of the cool rickshaw graphs.
To use this widget:
""" | |
Usage info: | |
Slap this file in a templatetags subdirectory off one of your apps: | |
In a template: | |
{% load crappy_page_filters %} | |
Then... given a situation like you were dealing with Haystack (and Twitter Boostrap style CSS) |
import redis | |
from django.conf import settings | |
from django.core.signals import request_finished | |
try: | |
from eventlet.corolocal import local | |
except ImportError: | |
from threading import local |
if brakes.abs_engaged: | |
horn.volume += 500 |
import datetime | |
CLARION_DAY_ZERO = datetime.date(1800,12,28) #this is the important date to work with! | |
def date_to_clarion_date(input_date): | |
""" | |
this is evil because I'm not checking jack... |