Skip to content

Instantly share code, notes, and snippets.

We are using Disqus SSO (2012) in conjunction with wordpress for one of our clients.
The site is in Spanish and the translation is mostly working.
http://screencast.com/t/h5aDGaX4aI
The Spanish translation for the actual comment thread works fine.
But the comment/reaction counts are still returned in English.
The comment counts that disqus replaces wordpress comment counts with comes from a file called count.js (it's part of the JSON in that file).
Is what we're trying to do not possible in 2012?
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()
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()
@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
@timbroder
timbroder / keybase.md
Created December 10, 2015 18:55
keybase.md

Keybase proof

I hereby claim:

  • I am timbroder on github.
  • I am timbroder (https://keybase.io/timbroder) on keybase.
  • I have a public key whose fingerprint is EB1E 3CD8 E2EB 5369 9898 4B3D 634C 9851 BC45 49A6

To claim this, I am signing this object:

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
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.
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',
function reloadStylesheets() {
var queryString = '?reload=' + new Date().getTime();
$('link[rel="stylesheet"]').each(function () {
this.href = this.href.replace(/\?.*|$/, queryString);
});
}
# Django settings for app project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS