Skip to content

Instantly share code, notes, and snippets.

@trojkat
trojkat / gist:1989762
Created March 6, 2012 23:30
django-shortcodes - YouTube parser
#~ # -*- coding: utf-8 -*-
from urlparse import urlparse, parse_qs
from django.template import Template, Context
from django.conf import settings
def video_id(value):
"""
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27862456-1']);
_gaq.push(['_setDomainName', 'herokuapp.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
@intents
intents / intents.html
Created March 30, 2011 14:50
Invoke Intents
<script type="text/javascript">
(function() {
if (window.__twitterIntentHandler) return;
var intentRegex = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,
windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes',
width = 550,
height = 420,
winHeight = screen.height,
winWidth = screen.width;