Skip to content

Instantly share code, notes, and snippets.

@iivvoo
iivvoo / gist:3349141
Created August 14, 2012 13:13
opposite axes
def test_opposites(self):
""" "scores" may contain values for opposite attribute values -
make sure the winner wins """
scores = {'Realistic': [8],
'Investigative': [7],
'Artistic': [6],
'Social': [2],
'Enterprising': [1],
'Conventional': [3]}
@iivvoo
iivvoo / migrate_filer.py
Created July 12, 2012 11:41
migrate "traditional" image fields to FilerImageField
# encoding: utf-8
from django.core.management.base import BaseCommand
##
## FancyImageModel is a plugin model holding a ImageField called "oldimage" and
## FilerImageField "image". It removed duplicates based on the basename of the original
## image. This may or may not work for you.
from imageplugin.models import FancyImageModel
@iivvoo
iivvoo / gist:1216877
Created September 14, 2011 15:30
queue stress testing
from google.appengine.ext import webapp
from google.appengine.ext import db
from google.appengine.api.taskqueue import Task, Queue
from google.appengine.ext import deferred
import datetime
import random
def generate_random(l=8):