Skip to content

Instantly share code, notes, and snippets.

@matclayton
matclayton / FB Like
Created May 17, 2011 04:11
Tracking FB social actions
<div id="fb-root"></div>
<script>
(function() {
window.fbAsyncInit = function() {
FB.Event.subscribe('edge.create', function(response) {
_gaq.push(['_trackSocial', 'facebook', 'like', response]);
});
FB.Event.subscribe('edge.remove', function(response) {
_gaq.push(['_trackSocial', 'facebook', 'unlike', response]);
});
@willcritchlow
willcritchlow / basic-gdata.py
Created May 11, 2011 22:11
The most basic Google Analytics access in python
import gdata.analytics.service
from datetime import date, timedelta
from xml.dom.minidom import parseString
def main():
client = gdata.analytics.service.AnalyticsDataService()
client.ClientLogin('<your email here>', '<your password here>')
today = date.today()
"libMemcached cache backend"
from django.core.cache.backends.base import (BaseCache,
InvalidCacheBackendError)
from django.utils.encoding import smart_unicode, smart_str
try:
import pylibmc as memcache
is_pylibmc = True
except ImportError: