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
# Instantiate a new client | |
import stream | |
client = stream.connect('key', 'secret') | |
# Assume the notification is aggregated on | |
# {% if verb.infinitive == 'like' %}{{ object }}{% else %}{{ id }}{% endif %} | |
notification_feed = client.feed('notification', '1') | |
# Add two likes, one comment and two follows | |
activities = [ |
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
# Instantiate a new client | |
import stream | |
client = stream.connect('key', 'secret') | |
# Assume the notification is aggregated on | |
# {% if verb.infinitive == 'like' %}{{ object }}{% else %}{{ id }}{% endif %} | |
notification_feed = client.feed('notification', '1') | |
# Add two likes, one comment and two follows | |
activities = [ |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<config> | |
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError> | |
<luceneMatchVersion>LUCENE_31</luceneMatchVersion> | |
<lib dir="../../contrib/extraction/lib" /> | |
<lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" /> | |
<lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" /> | |
<lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" /> | |
<lib dir="../../contrib/clustering/lib/" /> | |
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 re | |
def replace(url, key, value): | |
p = re.compile('%s=[^=&]*' % key, re.VERBOSE) | |
return p.sub('%s=%s' % (key, value), url) | |
url = 'http://www.google.com/?a=b&c=d&d=f' | |
print replace(url, 'a', 'test') | |
print replace(url, 'c', 'test') | |
print replace(url, 'd', 'test') |
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
@fashiolista_env | |
def health(request): | |
import random | |
from django.db import transaction, connections | |
from user.models import Profile | |
using = 'default' | |
def print_isolation_levels(using, msg): | |
autocommit_sql = "SHOW AUTOCOMMIT;" |
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 functools import wraps | |
from django.utils.decorators import available_attrs | |
class CachedDecorator(object): | |
""" | |
Decorator which cached the call to the give function. Usage example :: | |
@cached(key='notification_settings_%(user_id)s', timeout=60 * 10) | |
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
2013-08-26 13:49:11,820 [INFO] snaptastic.snapshotter: Attaching volume vol-b3b128e6 to instance i-ce402f81 | |
Aug 26 13:49:12 ip-10-37-176-131 startup: Traceback (most recent call last): | |
Aug 26 13:49:12 ip-10-37-176-131 startup: File "/usr/local/bin/snaptastic", line 9, in <module> | |
Aug 26 13:49:12 ip-10-37-176-131 startup: load_entry_point('snaptastic==0.2.10', 'console_scripts', 'snaptastic')() | |
Aug 26 13:49:12 ip-10-37-176-131 startup: File "/usr/local/lib/python2.7/dist-packages/snaptastic/cli.py", line 125, in main | |
Aug 26 13:49:12 ip-10-37-176-131 startup: p.dispatch() | |
Aug 26 13:49:12 ip-10-37-176-131 startup: File "/usr/local/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch | |
Aug 26 13:49:12 ip-10-37-176-131 startup: return dispatch(self, *args, **kwargs) | |
Aug 26 13:49:12 ip-10-37-176-131 startup: File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 123, in dispatch | |
Aug 26 13:49:12 ip-10-37-176-131 startup: for line in lines: |
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
Environment: | |
Request Method: POST | |
Request URL: http://foodtrip.ph/facebook/connect/?facebook_login=1 | |
Django Version: 1.5.4 | |
Python Version: 2.7.3 | |
Installed Applications: | |
('django.contrib.auth', | |
'django.contrib.contenttypes', | |
'django.contrib.sessions', | |
'django.contrib.sites', |
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
{ | |
"coord":{ | |
"lon":4.89, | |
"lat":52.37 | |
}, | |
"sys":{ | |
"message":0.0094, | |
"country":"NL", | |
"sunrise":1390721381, | |
"sunset":1390752987 |
OlderNewer