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 android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
import io.realm.RealmObject; | |
import io.realm.RealmResults; | |
public abstract class RealmAdapter<E extends RealmObject, VH extends RealmAdapter.ViewHolder> | |
extends BaseAdapter { |
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 inspect | |
import sys | |
def src(obj): | |
"""Read the source of an object in the interpreter.""" | |
def highlight(source): | |
try: | |
import pygments |
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.contrib.sessions.backends.base import SessionBase, CreateError | |
from django.conf import settings | |
from django.utils.encoding import force_unicode | |
import redis | |
class SessionStore(SessionBase): | |
""" Redis store for sessions""" | |
def __init__(self, session_key=None): | |
self.redis = redis.Redis( |
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
high quality greens: http://www.hibiki-an.com/ | |
https://shop.ippodo-tea.co.jp/shop/en/ | |
http://www.teaforte.com/ | |
sencha (Japanese green), and Assam (Indian black). | |
http://www.omshantea.com/ -- A cool tea house in SF (mission). Learn about Pu-erh and Jiaogulan here. | |
http://www.teaspring.com/ -- Chinese Tea. |
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 gevent | |
from gevent import monkey | |
monkey.patch_socket() | |
import hashlib | |
import os | |
import redis |
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.http import HttpRequest | |
class PickleableHttpRequest(HttpRequest): | |
def __init__(self, request=None, attributes=None): | |
super(PickleableHttpRequest, self).__init__() | |
if request: | |
if not isinstance(request, HttpRequest): | |
raise Exception('Request supplied is not a valid HTTP request object.') |
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
!function() { | |
var doc = document, | |
htm = doc.documentElement, | |
lct = null, // last click target | |
nearest = function(elm, tag) { | |
while (elm && elm.nodeName != tag) { | |
elm = elm.parentNode; | |
} | |
return elm; | |
}; |
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 fabric.api import * | |
""" | |
Base configuration | |
""" | |
env.project_name = '$(project)' | |
env.database_password = '$(db_password)' | |
env.site_media_prefix = "site_media" | |
env.admin_media_prefix = "admin_media" | |
env.newsapps_media_prefix = "na_media" |