Skip to content

Instantly share code, notes, and snippets.

View tobiasgoecke's full-sized avatar
🖖
working on next level of smart X environment

Tobias Goecke (Göcke) tobiasgoecke

🖖
working on next level of smart X environment
View GitHub Profile
@fish2000
fish2000 / flushemailqueue.py
Created October 16, 2010 10:51
Database email queue
#!/usr/bin/env python
# encoding: utf-8
import sys, os, getopt
from django.core.management import setup_environ
import settings
setup_environ(settings)
from django.db.models import Q
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

@enjalot
enjalot / index.html
Created September 8, 2011 15:15
Simple Pie Chart example with D3.js
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script>
<style type="text/css">
@dpnova
dpnova / gist:1223933
Created September 17, 2011 13:26
invalidate cache_page entries in django
def expire_view_cache(view_name, args=[], namespace=None, key_prefix=None, method="GET"):
"""
This function allows you to invalidate any view-level cache.
view_name: view function you wish to invalidate or it's named url pattern
args: any arguments passed to the view function
namepace: optioal, if an application namespace is needed
key prefix: for the @cache_page decorator for the function (if any)
from: http://stackoverflow.com/questions/2268417/expire-a-view-cache-in-django
added: method to request to get the key generating properly
@Christophe31
Christophe31 / tornado_django_wrapper.py
Created February 29, 2012 10:43
tornado django wrapper
############# init parent django project settings
from os import path
import sys
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import settings
from django.core.management import setup_environ
setup_environ(settings)
###############
@aderowbotham
aderowbotham / django_ami.md
Created June 7, 2012 14:19
Django stack setup on EC2 AMI

Django Stack

Overview

This is a set of instructions to setup a Django Nginx Gunicorn MySQL/Postgres stack on a single Amazon EC2 instance.

Server - AWS

@ndarville
ndarville / settings.py
Last active April 13, 2020 08:18
Django on Travis CI
"""A basic database set-up for Travis CI.
The set-up uses the 'TRAVIS' (== True) environment variable on Travis
to detect the session, and changes the default database accordingly.
Be mindful of where you place this code, as you may accidentally
assign the default database to another configuration later in your code.
"""
import os
@jamesoutterside
jamesoutterside / django_epub.py
Last active September 7, 2022 22:42
django epub builder
# Copyright (c) 2012, Bin Tan
# This file is distributed under the BSD Licence. See python-epub-builder-license.txt for details.
# James Outterside - Modified code from http://code.google.com/p/python-epub-builder/source/browse/trunk/epub.py to use
# use django templates instead of genshi
import itertools
import mimetypes
import os
import shutil
@Ahrengot
Ahrengot / open link in app
Created September 26, 2012 11:51
Prevent iOS web app's from opening internal links in safari