This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from django.test.client import Client | |
from django.conf import settings | |
from django.core.cache import cache | |
from django.utils.hashcompat import md5_constructor | |
register = template.Library() | |
@register.simple_tag | |
def esi(url, timeout=10): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map { | |
background-color: #ffffff; | |
} | |
#kommuner { | |
polygon-fill: #e8e4e4; | |
polygon-opacity: 1; | |
line-color: #a1a1a1; | |
line-width: 0.5; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ST_Multi(ST_UNION(ST_MakeValid(k.the_geom))) FROM norske_kommuner k WHERE nr IN ('1201', '1247', '1243') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.stack { | |
margin: 20px auto; | |
width: 400px; | |
padding: 0; | |
position: relative; | |
max-width: 100%; | |
} | |
.stack div { | |
max-width: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" ng-app="prosjektnavnApp"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<meta name="description" content=""> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"responses": [ | |
{ | |
"id": 455, | |
"responder_name": "Harald Schjelderup", | |
"responder_title": "Byrådslederkandidat", | |
"motivation": "Hei Heidi! Snegler er noe herk, men dette er nok ikke en sak for bystyret :) Lykke til med kampen i hagen! ", | |
"question": { | |
"id": 148, | |
"question": "Kan du love en handlingsplan mot brunsnegler? Hva går denne planen i så fall ut på?", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Depends on the OS X "say" command | |
import time, datetime, subprocess, math, sys | |
def say(s): | |
subprocess.call(['say', str(s)]) | |
def seconds_until(dt): | |
return time.mktime(dt.timetuple()) - time.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Memcached cache backend" | |
from django.core.cache.backends import memcached | |
from django.utils.encoding import smart_unicode, smart_str | |
MIN_COMPRESS_LEN = 150000 | |
class CacheClass(memcached.CacheClass): | |
def add(self, key, value, timeout=None, min_compress_len=MIN_COMPRESS_LEN): | |
if isinstance(value, unicode): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
import subprocess | |
import logging | |
from django.conf import settings | |
logger = logging.getLogger('pagetracker.grabber') | |
def grab_page(url, outfile): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="http://propublica.github.com/timeline-setter/public/stylesheets/timeline-setter.css" rel="stylesheet" /> | |
<script src="http://propublica.github.com/timeline-setter/public/javascripts/vendor/jquery-min.js"></script> | |
<script src="http://propublica.github.com/timeline-setter/public/javascripts/vendor/underscore-min.js"></script> | |
<script src="http://propublica.github.com/timeline-setter/public/javascripts/timeline-setter.js"></script> | |
<script src="../js/date.js"></script> | |
<style> | |
#timeline_setter .TS-item_label a { |
OlderNewer