Skip to content

Instantly share code, notes, and snippets.

@kdonaldson
kdonaldson / django-crossdomainxhr-middleware.py
Created September 8, 2012 17:16 — forked from jessykate/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
'''
EXAMPLE USAGE:
Put this file in a directory called, eg, 'middleware,' inside your django
@kdonaldson
kdonaldson / django-crossdomainxhr-middleware.py
Created September 8, 2012 17:18 — 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
@kdonaldson
kdonaldson / audio.html
Created September 24, 2012 07:19 — forked from macdonst/audio.html
PhoneGap Media Class Example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>PhoneGap Back Button Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.js"></script>
<script type="text/javascript" charset="utf-8">
var myMedia = null;
@kdonaldson
kdonaldson / tokbox.html
Last active August 29, 2015 14:06 — forked from andrew/tokbox.html
<!DOCTYPE html>
<html>
<head>
<title>OpenTok API Sample &#8212; Stand-Alone Archives</title>
<link href="/css/demos.css" type="text/css" rel="stylesheet" >
<script src="http://static.opentok.com/v1.1/js/TB.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var recorderManager;
var recorder;
var player;