Skip to content

Instantly share code, notes, and snippets.

View mdornseif's full-sized avatar

mdornseif mdornseif

View GitHub Profile
@mdornseif
mdornseif / gae_mini_profiler.patch
Created October 14, 2011 14:04
make gae_mini_profiler work with AppEngine 1.5.5 as of 2011-10-14
iff --git a/gaetk/gae_mini_profiler/middleware.py b/gaetk/gae_mini_profiler/middleware.py
index 04a1ba4..327a4fc 100644
--- a/gaetk/gae_mini_profiler/middleware.py
+++ b/gaetk/gae_mini_profiler/middleware.py
@@ -66,10 +66,12 @@ class ProfilerWSGIMiddleware(object):
old_app = self.app
def wrapped_appstats_app(environ, start_response):
# Use this wrapper to grab the app stats recorder for RequestStats.save()
- if hasattr(recording.recorder, "get_for_current_request"):
- self.recorder = recording.recorder.get_for_current_request()
@mdornseif
mdornseif / http.diff
Created December 8, 2011 09:06
Handle GAW GZIP issues
diff --git a/huTools/http/engine_appengine.py b/huTools/http/engine_appengine.py
index 74cf314..385df5d 100644
--- a/huTools/http/engine_appengine.py
+++ b/huTools/http/engine_appengine.py
@@ -12,8 +12,11 @@ Copyright (c) 2010, 2011 HUDORA. All rights reserved.
import huTools.http.tools
+import gzip
import logging
@mdornseif
mdornseif / pipeline.diff
Created December 12, 2011 01:56
Fix appengine-mapreduce for python27
diff --git a/lib/pipeline/pipeline.py b/lib/pipeline/pipeline.py
index 4c424bd..476683b 100755
--- a/lib/pipeline/pipeline.py
+++ b/lib/pipeline/pipeline.py
@@ -1068,8 +1068,6 @@ class InOrder(object):
"""
_local = threading.local()
- _local._in_order_futures = set()
- _local._activated = False
@mdornseif
mdornseif / shorten.py
Created April 30, 2012 08:14
URL verkürzen
# Verkürzen ein URL per call zu is.gd
def _tiny_url(url):
"""Does a API call to is.gd to get a shortened URL."""
apiurl = 'http://is.gd/api.php?longurl='
_status, _headers, content = huTools.http.fetch(apiurl + url, ua='cs.notifications')
return content
# Alle URLs in einem Text verkürzen
def _content_tiny_url(content):
@mdornseif
mdornseif / huLint.py
Created May 3, 2012 18:20
This program analyzes Python code with pylint and calculates a credit for the code, depending on a miimum required score and the previous run.
#!/usr/bin/env python
"""
Credit System for Python Code
This program analyzes Python code with pylint
and calculates a credit for the code, depending
on a miimum required score and the previous run.
"""
import sys
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Hackish Script to leech Karst/Cave Data from
# http://environnement.wallonie.be/cartosig/index.asp
# See http://cavehackers.de/77347676 for some background
import codecs
import urllib2
import re
@mdornseif
mdornseif / gist:2834507
Created May 30, 2012 08:19 — forked from ambar/gist:1534274
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@mdornseif
mdornseif / finde.py
Created August 27, 2012 15:47
Reconstruct your Travel Route based on GPS Information in a folder of Pictures
# Reconstruct your Travel Route based on GPS Information
# in a folder of Pictures
# Files to watch for
pattern = '*.JPG'
# Dirs to search
roots = ['/Users/md/Pictures/iPhoto Library/Originals', '/Users/md/Pictures/Aperture Library.aplibrary/Masters/2012/']
# output is in `reise.kml`
@mdornseif
mdornseif / wp2dayone.py
Created March 26, 2013 07:30
Move Posts from Github to Dayone.
# transfer entries from a Wordpress blog to the DayOne app
# deletes the postings in Wordpress
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods.posts import GetPosts, NewPost, DeletePost
from wordpress_xmlrpc.methods.users import GetUserInfo
import os
import subprocess
import time
{
"annotations": [
{
"type": "net.app.core.oembed",
"value": {
"title": "In der Wand!",
"url": "http:\/\/distilleryimage11.s3.amazonaws.com\/b0672d1ec53411e2a9ea22000ae81462_7.jpg",
"height": 612,
"width": 612,
"version": "1.0",