View gist:3d4b9057f266e599bd49
from django.test import Client | |
from spec import Spec | |
from nose.tools import * | |
from spec.plugin import SkipTest | |
from wall.models import Wall, Card, Row, Column | |
from wall.factories import WallFactory, CardFactory, RowFactory, ColumnFactory | |
import json | |
class CardWallApplication(Spec): | |
def setup(self): |
View gist:233222b96e1ae1ca9971
from sniffer.api import * # import the really small API | |
import os, termstyle, subprocess | |
# you can customize the pass/fail colors like this | |
pass_fg_color = termstyle.green | |
pass_bg_color = termstyle.bg_default | |
fail_fg_color = termstyle.red | |
fail_bg_color = termstyle.bg_default | |
# All lists in this variable will be under surveillance for changes. |
View gist:4026171
class WordpressRouter(object): | |
""" Database router - for the moment, everything to default except the wordpress app, which has its own setting """ | |
def db_for_read(self, model, **hints): | |
if model._meta.app_label == 'wordpress': | |
return 'wordpress' | |
return None | |
def db_for_write(self, model, **hints): | |
if model._meta.app_label == 'wordpress': |
View azsosxmlparse.py
import requests | |
import lxml | |
from lxml import etree | |
from decimal import * | |
from jinja2 import Template | |
import codecs | |
r = requests.get('http://www.azsos.gov/ftp/dbelec/detail.xml') | |
xml_source = r.text | |
root = etree.fromstring(xml_source) |
View part1.py
import requests | |
import csv | |
from pyquery import PyQuery as pq | |
f = open('strike_all_bills.csv', 'w') | |
wr = csv.DictWriter(f, ['billno']) | |
req = requests.get('http://www.azleg.gov/StrikeEverything.asp') | |
html = pq(req.text) | |
rows = html('tr.TableHeaderBackground').siblings() |
View gist:1849167
for file in `ls`:; do rm /Users/mng/Documents/MapBox/export/$file.mbtiles; tilemill export $file /Users/mng/Documents/MapBox/export/$file.mbtiles --format=mbtiles --files=/Users/mng/Documents/MapBox; tilemill export $file /Users/mng/Documents/MapBox/export/$file.mbtiles --format=upload --files=/Users/mng/Documents/MapBox; done |
View gist:1838431
import os | |
from django.conf import settings | |
from django.core.management.base import NoArgsCommand | |
from django.template.loader import render_to_string | |
from prey.models import State | |
class Command(NoArgsCommand): | |
"""command for creating templated tilemill projects""" | |
def handle_noargs(self, *args, **kwargs): |
View gist:1148062
jQuery(document).ready(function() { | |
var triggers_in_viewport = []; | |
checkTriggers(); | |
$(window).scroll(function(event) { | |
checkTriggers(); | |
}); | |
$('aside h3 a').click(function(event) { | |
showAside($(this).attr('href')); | |
}); |
View gist:1101904
#!/usr/bin/env python | |
import sys, tty, termios | |
fd = sys.stdin.fileno() | |
old_settings = termios.tcgetattr(fd) | |
try: | |
filename = sys.argv[1] | |
f = open(filename, 'r') | |
text = f.read() |
View style.mss
@sans:"Droid Sans Book","Liberation Sans Regular","Arial Regular","DejaVu Sans Book"; | |
@sans_bold:"Droid Sans Bold","Liberation Sans Bold","Arial Bold","DejaVu Sans Bold"; | |
Map { | |
} | |
#world { | |
polygon-fill: #363636; | |
line-color: #ccc; | |
line-width: 0.5; |
NewerOlder