This file contains hidden or 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/env python | |
# c.klein: Django tool for pro-active bug fixing and support: | |
# find out to which user a session is bound. | |
from django.core.management import setup_environ | |
import settings | |
setup_environ(settings) | |
from django.contrib.sessions.models import Session | |
from django.contrib.auth.models import User |
This file contains hidden or 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
c0ldcut:hdMashup md$ git config --global color.diff=auto | |
c0ldcut:hdMashup md$ git config --global color.status=auto | |
c0ldcut:hdMashup md$ git config --global color.branch=auto | |
c0ldcut:hdMashup md$ echo 'EDITOR=/usr/local/bin/mate_wait' >> ~/.bash_profile | |
c0ldcut:hdMashup md$ echo 'VISUAL=$EDITOR' >> ~/.bash_profile |
This file contains hidden or 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 os | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp import template | |
class Homepage(webapp.RequestHandler): | |
def render(self, values, template_name): | |
path = os.path.join(os.path.dirname(__file__), template_name) | |
self.response.out.write(template.render(path, values)) | |
def paginate(self, query): |
This file contains hidden or 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
deploy: | |
appcfg.py update . | |
check: lib/google_appengine/google/__init__.py | |
pep8 -r --ignore=E501 views/ *.py views | |
sh -c 'PYTHONPATH=`python ./config.py` pyflakes *.py views/' | |
-sh -c 'PYTHONPATH=`python ./config.py` pylint -iy --max-line-length=110 *.py' # -rn | |
lib/google_appengine/google/__init__.py: | |
curl -O http://googleappengine.googlecode.com/files/google_appengine_1.3.8.zip |
This file contains hidden or 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/env python | |
# encoding: utf-8 | |
""" | |
do_openid_login.py | |
Created by Maximillian Dornseif on 2010-09-24. | |
Copyright (c) 2010 HUDORA. All rights reserved. | |
""" | |
This file contains hidden or 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 MyHandler(webapp.RequestHandler): | |
def __init__(self): | |
self.credential = None | |
def initialize(self, request, response): | |
super(MyHandler, self).initialize(request, response) | |
uid, secret = None, None | |
if self.request.headers.get('Authorization'): | |
auth_type, encoded = self.request.headers.get('Authorization').split(None, 1) | |
if auth_type.lower() == 'basic': |
This file contains hidden or 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
dependencies: update_submodules update_virtualenv | |
update_virtualenv: | |
virtualenv --python=python2.5 --no-site-packages --unzip-setuptools pythonenv | |
pythonenv/bin/pip -q install -E pythonenv -r requirements.txt | |
update_submodules: clean | |
git submodule update --init lib/jinja2/ | |
git submodule update --init lib/CentralServices/ | |
git submodule update --init lib/DeadTrees/ |
This file contains hidden or 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/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2009 Maximillian Dornseif <[email protected]> | |
# | |
# This software is licensed as described in the file COPYING, which | |
# you should have received as part of this distribution. | |
""" | |
This script replicates databases from one CouchDB server to an other. |
This file contains hidden or 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 | |
# Das Python-Setup auf balancer ist beinahe | |
# totally fucked up | |
# /usr/local/bin/ liegt im PATH vor /usr/bin, | |
# aber mit dem von Hand installierten Python | |
# dort klappt die Geschichte nicht... | |
# Datenbank als Unicode erzeugen: | |
# $ createdb softmmirror --encoding=UNICODE -O softm -e | |
# CREATE DATABASE softmmirror OWNER softm ENCODING 'UNICODE'; |
This file contains hidden or 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
DELETE FROM buchdurchschnittspreis2 | |
WHERE id in | |
(SELECT buchdurchschnittspreis2.id FROM buchdurchschnittspreis2 | |
LEFT OUTER JOIN (select min(id) as id from buchdurchschnittspreis2 | |
GROUP BY (artnr, datum) as KeepRows | |
ON buchdurchschnittspreis2.id=KeepRows.id | |
WHERE KeepRows.id IS NULL); |