This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function justonce(){ | |
E_BADARGS=65 | |
if [ $# -lt 2 ] | |
then | |
echo "Usage: `justonce <envname> <command>`" | |
exit $E_BADARGS | |
fi | |
workon $1 | |
shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import argparse | |
import random | |
mappings = { | |
'a': [u'à', u'â'], | |
'c': [u'ç'], | |
'e': [u'é', u'è', u'ê'], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import argparse | |
import random | |
mappings = { | |
'a': u'ä', | |
'o': u'ö', | |
'u': u'ü', | |
'k': 'ch', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from pprint import pformat | |
register = template.Library() | |
@register | |
def wtf(obj): | |
return pformat(obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nothing here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from django.conf import settings | |
from django.http import HttpResponseRedirect | |
DEFAULT = 'http://www.getfirefox.com' | |
class IE6CountdownMiddleware(object): | |
""" | |
Do *very* simple user agent scanning and redirect anyone accessing your site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LinkPlugin(CMSPluginBase): | |
def get_embed_content(self, instance, parent_instance): | |
ctx = Context() | |
return render_to_string(self.render_template, self.render(ctx, instance, None)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################## | |
# | |
# Copyright (c) 2006 Zope Corporation and Contributors. | |
# All Rights Reserved. | |
# | |
# This software is subject to the provisions of the Zope Public License, | |
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. | |
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | |
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
WARNINGS: THIS SCRIPT COMES WITHOUT ANY WARRANTY AND RUNNING IT IS DONE SO AT YOUR OWN RISK! | |
''' | |
from cms.models import Page | |
def setup(): | |
from django.contrib.auth.models import User | |
from cms.utils.permissions import set_current_user | |
set_current_user(User.objects.get(id=1)) | |
def check_no_moderator(): |