Skip to content

Instantly share code, notes, and snippets.

View psd's full-sized avatar

Paul Downey psd

View GitHub Profile
__pycache__
.pytest_cache
*.log
from django.db import transaction
from django.db import models
class Collection(models.Model):
name = models.CharField(blank=True, max_length=100)
revision = models.IntegerField(blank=True, null=False)
@transaction.atomic
def save(self, items_dict, *args, **kwargs):
@heathd
heathd / example.erb
Last active December 14, 2015 07:08
Hello <%= name %>!
anonymous
anonymous / fonts.html
Created January 2, 2013 19:08
Find Wikipedia font boxes
<!doctype html>
<html>
<head>
<style>
img {
width: 200px;
}
textarea {
width: 100%;
}
@robyoung
robyoung / gist:2580217
Created May 2, 2012 20:33
Bit set encoding for number of options in a url
import unittest
import math
import base64
import bz2
import gzip
import StringIO
import struct
class BitSetEncoder(object):
def encode(self, integers):
@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
# Hosts that serve up SKOS in the Billion Triple Challenge dataset:
#
# http://challenge.semanticweb.org/
#
# Results are ordered by the number of SKOS triples from the host, and were calculated with the
# following command:
#
# zgrep 'http://www.w3.org/2004/02/skos/core' btc-2010-chunk-*.gz | quadtabs.pl | cut -d "<ctrl-v><tab>" -f 4 | sort | uniq -c | sort -rn
#
# where quadtabs.pl = http://gist.github.com/574679
qunit.js