Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View pifantastic's full-sized avatar

Aaron Forsander pifantastic

  • Stripe
  • Austin, TX
View GitHub Profile
define([
'fixtures'
], function (fixtures) {
describe('Some unit tests', function () {
before(function () {
/**
* Will add the following HTML to the DOM before running the following tests:
*

Keybase proof

I hereby claim:

  • I am pifantastic on github.
  • I am forsander (https://keybase.io/forsander) on keybase.
  • I have a public key whose fingerprint is 77FA 89D6 D5C8 F0BE 518B D7A4 11EF 18B0 F691 E071

To claim this, I am signing this object:

import Ember from 'ember';
// Mock underscore.
let _ = {
includes: function(val) {
return this.indexOf(val) !== -1;
}
};
function enumProp(def, valid) {
def time_left(self):
if self.completed:
return 0
start = int(time.mktime(self.starttime.timetuple()))
now = int(time.mktime(datetime.datetime.now().timetuple()))
time_left = start + (settings.ATTACK_DURATION * 60) - now
if time_left > 0:
return time_left
def rand_color():
return "#%06x" % (math.floor(random.randint(10000, 16777215)))
bbox = Polygon.from_bbox((rect.x, rect.y, (rect.x + rect.width), (rect.y + rect.height)))
zipcodes = Zipcode.objects.filter(geom__intersects=bbox)
import fileinput
for file in files:
for n,line in enumerate(fileinput.FileInput(file, inplace=1)):
if n == 0: print "HEADER"
print line
def draw_tile(x, y, z):
# Create a blank, transparent tile
tile = Image.new("RGBA", (gmap.TILE_SIZE, gmap.TILE_SIZE), (0, 0, 0, 0))
# Query for Zipcodess within bounding box
rect = gmap.getTileRect(x, y, z)
bbox = Polygon.from_bbox((rect.x, rect.y, (rect.x + rect.width), (rect.y + rect.height)))
zipcodes = Zipcode.objects.filter(geom__intersects=bbox)
# Draw polygons on tile
def draw_tile(x, y, z):
# Create a blank, transparent tile
tile = Image.new("RGBA", (gmap.TILE_SIZE, gmap.TILE_SIZE), (0, 0, 0, 0))
# Query for Zipcodess within bounding box
rect = gmap.getTileRect(x, y, z)
bbox = Polygon.from_bbox((rect.x, rect.y, (rect.x + rect.width), (rect.y + rect.height)))
zipcodes = Zipcode.objects.filter(geom__intersects=bbox)
# Draw polygons on tile
import os
import sys
import re
class Station:
def __init__(self, file):
file = open(file, 'r')
self.data = { "obs": {} }
for line in file.readlines():