This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xF63Eb5d5F60eB66Da323516a7EfF40d8d389400c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> | |
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# climbingapp: http://ogp.me/ns/fb/climbingapp#"> | |
<!-- Open Graph Meta tags --> | |
<meta property="og:type" content="climbingapp:mountain" /> | |
<meta property="og:url" content="http://example.com/" /> | |
<meta property="og:title" content="Snowdon" /> | |
<meta property="og:description" content="Snowdon is the highest mountain in Wales" /> | |
<meta property="og:image" content="http://farm8.staticflickr.com/7172/6622506511_3f6a78e781_z.jpg" /> | |
<meta property="og:locale" content="en_GB" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id=”fb-root”></div> | |
<script> | |
window.fbAsyncInit = function(){ | |
FB.init({ appId:‘YOUR ID’, status:true, cookie:true, xfbml:true}); | |
FB.getLoginStatus(function(response){ | |
_gaq.push([‘_trackEvent’, ’FB’, ‘status’, response.status]); | |
}); | |
}; | |
// Load the SDK Asynchronously | |
(function(d){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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]); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
from dateutil.parser import parse as iso8601 | |
from celery.task.base import Task | |
from celery.utils import timedelta_seconds | |
class ExpireTask(Task): | |
"""Task with an expiration time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Thread-safe Django cache backend for pylibmc. | |
Tested on Python 2.6, should work on 2.5 as well. | |
Use it by setting CACHE_BACKEND in settings.py, e.g.: | |
CACHE_BACKEND = 'projdir.utils.pylibmcd://127.0.0.1:11211/' | |
""" | |
from __future__ import with_statement | |
from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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: |