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
def hash_join(left, right, join_key, attr_keys, outer=True): | |
""" | |
Allows you to join the keys/values from a list of dictionaries as the | |
attributes of a given list of objects. | |
Params:: | |
- left - list of objects to join to | |
- right - list of dictionaries from which to get joined data | |
- join_key - attribute of both object and dictionary with which we can match |
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 django.conf import settings | |
from django.contrib.sessions.backends.base import SessionBase | |
from django.core.cache import cache | |
from PHPSerialize import PHPSerialize | |
from PHPUnserialize import PHPUnserialize | |
from session_models import SessionEntry | |
from datetime import timedelta | |
from sqlalchemy import func, text | |
from sharding import Session |
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
<?php | |
class CachedSessionHandler { | |
private static $LOG_SESSION_ACTIVITY = false; | |
private static $binding; | |
private $cache; | |
private $read_sessions = array(); | |
public static function bind($database) |
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
import json, urllib2, pprint | |
""" | |
Mess around with goo.gl shortener API | |
""" | |
kind = "SHORTEN" | |
key = "YOUR_KEY" | |
api_url = "https://www.googleapis.com/urlshortener/v1/url?key=%s" % key |
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
>>> brew install -vd libvpx | |
==> Build Environment | |
CC: /usr/bin/cc => /usr/bin/gcc-4.0 | |
CXX: /usr/bin/c++ => /usr/bin/c++-4.0 | |
LD: /usr/bin/cc => /usr/bin/gcc-4.0 | |
CFLAGS: -O3 -march=nocona -mfpmath=sse -w -pipe | |
CXXFLAGS: -O3 -march=nocona -mfpmath=sse -w -pipe | |
MAKEFLAGS: -j2 | |
==> Downloading http://webm.googlecode.com/files/libvpx-v0.9.2.tar.bz2 | |
File already downloaded and cached to /Users/alex2/Library/Caches/Homebrew |
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
// init the storage object | |
var people = new Lawnchair('people'); | |
// save an object | |
var me = {name: 'alex'}; | |
people.save(me); | |
// what is the people object? | |
console.log(people) |
NewerOlder