Skip to content

Instantly share code, notes, and snippets.

Skylar Saveland skyl

Block or report user

Report or block skyl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
skyl / gist:866920
Created Mar 12, 2011
shruti system
View gist:866920
In [35]: shrutis = {
....: 0: (1/Decimal('1'),),
....: 1: (256/Decimal('243'), 16/Decimal('15')),
....: 2: (10/Decimal('9'), 9/Decimal('8')),
....: 3: (32/Decimal('27'), 6/Decimal('5')),
....: 4: (5/Decimal('4'), 81/Decimal('64')),
....: 5: (4/Decimal('3'),),
....: # 27/Decimal('20'),
....: 6: (45/Decimal('32'), 729/Decimal('512')),
....: 7: (3/Decimal('2'),),
skyl / gist:849500
Created Mar 1, 2011
stashing a mediocre idea
View gist:849500
import djredis.models as djr
class MyMod(models.Model, djr.DredisMixin):
currency = models.CharField(max_length=3)
djr_currency = djr.String()
cache_fields = (('currency', 'djr_currency'),)
skyl / gist:778973
Created Jan 14, 2011
rough openlayers example
View gist:778973
<!DOCTYPE html>
<html lang="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
Example Site : Welcome
View gist:775697
def _action(action, o):
o.is_processing = False
def _bulk_action(action, objs):
for o in objs:
skyl / gist:764182
Created Jan 3, 2011
TxBl api sample
View gist:764182
v1 = Stepper(
[60,30,30,30,50,N] * 2 + [120,40,40,120,40,40] * 2
n1 = snd(cycle(
d1 = rhodes_f()
player1 = Player(d1, n1, v1, interval=sixteenth)
View gist:753900
from django import db
from django.db import connection
from django.conf import settings
class LoggingMiddleware(object):
def process_request(self, request):
"""Logs the POST (and resets the queries if DEBUG)"""
View Tomjunk
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
Google Visualization API Sample
<script type="text/javascript" src=""></script>
<script type="text/javascript">
skyl / gist:423540
Created Jun 3, 2010
View gist:423540
from django.db import models
from mymongo.models import Mongo
class M(models.Model):
mongo = Mongo()
from djredis.models import DredisMixin
import djredis.models
class Blog(models.Model, DredisMixin): # inherit from the mixin class
author = models.ForeignKey('Author')
title = models.CharField(max_length=200)
# declaratively add your redis fields
viewcount = djredis.models.Counter()
View gist:297913
::site-wide keys::
The set of usernames.
r.sismember('users', 'foouser')
List of all groups
You can’t perform that action at this time.