Skip to content

Instantly share code, notes, and snippets.

AUTHENTICATION_BACKENDS = (
'social_auth.backends.google.GoogleOAuth2Backend',
# 'social_auth.backends.google.GoogleBackend',
# 'django.contrib.auth.backends.ModelBackend',
)
SOCIAL_AUTH_ENABLED_BACKENDS = ('google-oauth2')
GOOGLE_OAUTH_EXTRA_SCOPE = ['http://www.google.com/m8/feeds', 'http://www.google.com/reader/api/', 'http://www.google.com/reader/atom/', 'https://www.googleapis.com/auth/plus.me']
SOCIAL_AUTH_DEFAULT_USERNAME = 'new_social_auth_user'
SOCIAL_AUTH_UUID_LENGTH = 16
# Django settings for app project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'app.views.home', name='home'),
# url(r'^app/', include('app.foo.urls')),
function reloadStylesheets() {
var queryString = '?reload=' + new Date().getTime();
$('link[rel="stylesheet"]').each(function () {
this.href = this.href.replace(/\?.*|$/, queryString);
});
}
keys = ['job_2254-t02240.pdf',
'job_2254-t02240.pdf',
'job_2254-t02244.pdf',
'job_2254-t02241.pdf',
'job_2254-t02242.pdf',
'job_2254-t02293.pdf',
'job_2254-t02243.pdf',
'job_2254-t0220.pdf',
'job_2254-t0221.pdf',
'job_2254-t0222.pdf',
March 24, 2005
Blossom Street
"And I could hear his footsteps creeping past my window.
It was before dawn.
It was so dark, I couldn't read my watch.
But his footsteps awoke me just the same.
And I crept downstairs to see old Adam on his knees past the outhouse.
He was digging.
I crouched behind the outhouse, watching his every move.
theme loaded
app ready
pre session restore time: 0.675485
using gamma: 2 (err: 6.9282)
wrote startup cache, added files: 2 orphaned files: 0 total files: 101 cache hits: 99
startup time: 0.976856 (package setup was not run)
loaded 837 snippets
Package Control: Installing 16 missing packages
Package Control: Download Debug
URL: https://sublime.wbond.net/repositories.json
@timbroder
timbroder / gist:4547825
Last active December 11, 2015 04:48
adding facet.mincount to django-haystack
#the backend
class MySolrBackend(SolrSearchBackend):
def build_search_kwargs(self, *args, **kwargs):
facet_mincount = kwargs.pop('facet_mincount', None)
search_kwargs = super(AiSolrBackend, self).build_search_kwargs(*args, **kwargs)
if facet_mincount is not None:
search_kwargs['facet'] = 'on'
search_kwargs['facet.mincount'] = facet_mincount
from bs4 import BeautifulSoup
import urllib2, urllib
import sys
import imghdr
import os
root = "http://www.imgspark.com"
base = "%s/image/popular/sethwhitton/alltime/" % root
page = urllib2.urlopen(base).read()
def save(self,*args,**kwargs):
self.response = self.response.lower()
if not self.expiration:
self.expiration = datetime.datetime.now() + datetime.timedelta(minutes= int(captcha_settings.CAPTCHA_TIMEOUT))
if not self.hashkey:
key_ = unicodedata.normalize('NFKD', str(randrange(0,MAX_RANDOM_KEY)) + str(time.time()) + unicode(self.challenge)).encode('ascii', 'ignore') + unicodedata.normalize('NFKD', unicode(self.response)).encode('ascii', 'ignore')
if hashlib:
self.hashkey = hashlib.new('sha', key_).hexdigest()
else:
self.hashkey = sha.new(key_).hexdigest()