Skip to content

Instantly share code, notes, and snippets.

View ulope's full-sized avatar

Ulrich Petri ulope

View GitHub Profile
simplejson
-e svn+http://code.djangoproject.com/svn/django/trunk/#egg=django
-e hg+http://bitbucket.org/andrewgodwin/south/#egg=south
-e hg+http://bitbucket.org/offline/django-annoying/#egg=django-annoying
-e git+git://github.com/robhudson/django-debug-toolbar.git#egg=django-debug-toolbar
-e git+git://github.com/dcramer/django-devserver.git#egg=django-devserver
-e git+git://github.com/ulope/django-extensions.git#egg=django-extensions
-e git+git://github.com/ulope/django-reversetag.git#egg=django-reversetag
diff --git a/docs/custom_plugins.rst b/docs/custom_plugins.rst
index 31ba3c5..d3ee68e 100644
--- a/docs/custom_plugins.rst
+++ b/docs/custom_plugins.rst
@@ -254,7 +254,8 @@ In your yourapp.cms_plugin_processors.py::
This plugin processor wraps each plugin's output in a colored box if it is in the "main" placeholder.
'''
if placeholder.slot != 'main' \ # Plugins not in the main placeholder should remain unchanged
- or instance._render_meta.text_enabled: # Plugins embedded in Text should remain unchanged in order not to break output
+ or (instance._render_meta.text_enabled # Plugins embedded in Text should remain unchanged in order not to break output
@ulope
ulope / Google search domain ranking
Created February 18, 2011 19:22
This is an attemt to make the code from http://blog.jgc.org/2011/02/how-could-i-have-coded-this-better.html a bit more pythonic
#!/usr/bin/env python
import csv
import sys
from BeautifulSoup import BeautifulSoup
import urllib, urllib2
from urlparse import urlparse
from collections import defaultdict
__doc__ = """
Script to perform Google searches and extract the domain names of
@ulope
ulope / gist:1017687
Created June 9, 2011 20:41
django #15552 patch v1
From cccb047c79211bfa3f89760a206009f706168728 Mon Sep 17 00:00:00 2001
From: Ulrich Petri <ulo@ulo.pe>
Date: Thu, 9 Jun 2011 22:38:33 +0200
Subject: [PATCH] Refactored settings.LOGIN_URL, LOGIN_REDIRECT_URL to use the logic from django.shortcuts.redirect (i.e. allow view names in LOGIN_URL, et. al.)
---
django/contrib/auth/decorators.py | 5 ++-
django/contrib/auth/tests/decorators.py | 2 +-
django/contrib/auth/views.py | 13 +++++---
django/shortcuts/__init__.py | 19 +----------
diff --git a/web/js/Renderer/Lightbox.js b/web/js/Renderer/Lightbox.js
index c9c2149..920f72a 100755
--- a/web/js/Renderer/Lightbox.js
+++ b/web/js/Renderer/Lightbox.js
@@ -139,7 +139,7 @@ XtLightbox.Renderer.Lightbox = new Class({
close: true
}, options);
this.empty();
- this.elTitle.set('text', options.title || '');
+ this.elTitle.set('html', options.title || '');
@ulope
ulope / gist:1189656
Created September 2, 2011 19:37 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: Software Developer
Favorite Python project: too many to name
Favorite Conference: djangocon.(eu|us)
Python Experience Level: I talk python ;)
~# apt-cache policy ubuntu-zfs spl spl-dkms zfs-dkms zfsutils
spl-dkms:
Installed: 0.6.0.31-0ubuntu1~natty1
Candidate: 0.6.0.32-0ubuntu1~natty1
Version table:
0.6.0.32-0ubuntu1~natty1 0
500 http://ppa.launchpad.net/dajhorn/zfs/ubuntu/ natty/main amd64 Packages
*** 0.6.0.31-0ubuntu1~natty1 0
100 /var/lib/dpkg/status
spl:
from operator import attrgetter
import random
import string
import sys
# Evolutionary word finding.
# Inspired by: http://www.electricmonk.nl/log/2011/09/28/evolutionary-algorithm-evolving-hello-world/
#
#
# Copyright (c) 2011, Ulrich Petri <mail@ulo.pe>
@ulope
ulope / fs_stress.py
Created March 5, 2012 15:23
FS Stressing (my use case: Provoking ZFS on Linux hang bugs)
#!/usr/bin/env python
# Copyright (c) 2012 Ulrich Petri <mail@ulo.pe>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@ulope
ulope / css.css
Created April 19, 2012 17:06
CSS A4 page ruler
#page .ruler {
position: absolute;
}
#page .ruler.horz span {
width: 1cm;
height: 297mm;
display: block;
position: absolute;
}