Skip to content

Instantly share code, notes, and snippets.

View andres-torres-marroquin's full-sized avatar
🎯
Focusing

Andres Torres andres-torres-marroquin

🎯
Focusing
View GitHub Profile
(deltamedix)ed@HinduKush:~/projects/deltamedix/deltamedix$ cat /etc/freetds/freetds.conf
# $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
#
# This file is installed by FreeTDS if no file by the same
# name is found in the installation directory.
#
# For information about the layout of this file and its settings,
# see the freetds.conf manpage "man freetds.conf".
# Global settings are overridden by those in a database
@andres-torres-marroquin
andres-torres-marroquin / django-crossdomainxhr-middleware.py
Created March 12, 2012 18:52 — forked from vicalejuri/django-crossdomainxhr-middleware.py
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
"""
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = LockFile('somefile')
>>> try: