Skip to content

Instantly share code, notes, and snippets.

View sivy's full-sized avatar

Steve Ivy sivy

View GitHub Profile
Environment:
Request Method: GET
Request URL: http://localhost:8080/nexus/admin/typepadapp/subscription/2/delete/
Django Version: 1.3
Python Version: 2.6.1
Installed Applications:
['django.contrib.auth',
@sivy
sivy / mig.yaml
Created April 12, 2011 16:37
config file for a static site
type: static
envs:
staging:
host: hammer.wallrazer.com
url: http://hammer.wallrazer.com
working_dir: /var/makeitgoo/wallrazer.com/
dest_dir: /var/www/
build_dir: /tmp/_site
path: /usr/local/git/bin/
post_update: post_update.sh
@sivy
sivy / gist:935096
Created April 21, 2011 17:54
celery-redis.py
# celery
BROKER_BACKEND = "redis"
BROKER_HOST = "localhost" # Maps to redis host.
BROKER_PORT = 6379 # Maps to redis port.
BROKER_VHOST = "0" # Maps to database number.
CELERY_TRACK_STARTED = True
@sivy
sivy / cansofcoke.py
Created April 23, 2011 05:43
In college I had a cabinet-style folding desk, upon the top of which i started stacking all the cans of Coke I drank that quarter (it was design school!).
#!/usr/bin/env python
"""
In college I had a cabinet-style folding desk, upon the top of which i started stacking all the cans of Coke I
drank that quarter (it was design school!). I remembered that at the top of the stack (a pyramid in which the x
and y directions of each level were one less than the level below) was a 1x3 row of cans. How many in all did I
drink, if I remember the total was more then, say, 300 and less than, say 400?
"""
total=0
# the top row, at around ceiling level:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
var int_id = setInterval(500, function(){
$.ajax({
cache:false,
dataType:'html',
url:'/check_deploy?resp=7fa19233-cd39-4aa8-87c9-8f2b2520bf75',
success:function(data){
if (data!='NO') {
@sivy
sivy / celeryd.log
Created May 8, 2011 15:59
error log from celery running on redis
(virtual)sivy$ ./manage.py celeryd -l debug
/var/pushcode/pushcode/virtual/lib/python2.6/site-packages/django/db/models/fields/subclassing.py:80: DeprecationWarning: A Field class whose get_db_prep_save method hasn't been updated to take a `connection` argument.
new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs)
/var/pushcode/pushcode/virtual/lib/python2.6/site-packages/django/db/models/fields/subclassing.py:80: DeprecationWarning: A Field class whose get_db_prep_value method hasn't been updated to take `connection` and `prepared` arguments.
new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs)
/var/pushcode/pushcode/virtual/lib/python2.6/site-packages/djcelery/loaders.py:80: UserWarning: Using settings.DEBUG leads to a memory leak, neveruse this setting in production environments!
warnings.warn("Using settings.DEBUG leads to a memory leak, never"
[2011-05-08 08:25:47,963: WARNING/MainProcess]
-------------- celery@wr-node1 v2.2.6
@sivy
sivy / gist:980013
Created May 19, 2011 01:54
config.yaml
name: "Private Label Feed"
version: 0.1
id: PrivateLabelFeed
key: PrivateLabelFeed
author_name: Endevver, LLC
author_link: http://endevver.com/
static_version: 0
description: "Setup a local redirect to a third party feed server."
callbacks:
class AppForm(ModelForm):
key_gen = models.BooleanField(default=False, verbose_name='Generate Key')
class Meta:
model = App
fields = ('name', 'remote_url', 'ssh_pub_key', 'config_cache', 'user', 'key_gen') # key_gen is just on the form
tt:[~/PROJECTS/Wallrazer/wallrazer-svn]> svn checkout http://wallrazer-com-svn.googlecode.com/svn/trunk/ wallrazer-com-svn-read-only
svn: OPTIONS of 'http://wallrazer-com-svn.googlecode.com/svn/trunk': 200 OK (http://wallrazer-com-svn.googlecode.com)
tt:[~/PROJECTS/Wallrazer/wallrazer-svn]>
@sivy
sivy / comma_string_multiple_choice_field.py
Created July 21, 2011 00:56
CommaStringMultipleChoiceField - store multiple values as a comma-delimited string in Django
class CommaStringMultipleChoiceField(MultipleChoiceField):
def to_python(self, value):
if isinstance(value,str):
return [val.rstrip().lstrip() for val in value.split(',')]
else:
return []
def prepare_value(self, value):
return self.to_python(value)