This file contains hidden or 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
| class CORSResource(object): | |
| """ | |
| Adds CORS headers to resources that subclass this. | |
| """ | |
| def create_response(self, *args, **kwargs): | |
| response = super(CORSResource, self).create_response(*args, **kwargs) | |
| response['Access-Control-Allow-Origin'] = '*' | |
| response['Access-Control-Allow-Headers'] = 'Content-Type' | |
| return response |
This file contains hidden or 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
| var lsCache = function() { | |
| var TIMEOUT_DEFAULT = 60; | |
| var self = { | |
| set: function(key, val, timeout) { | |
| var timeout = parseInt(timeout, 10) || TIMEOUT_DEFAULT; | |
| var now = Math.round(new Date().getTime() / 1000); | |
| localStorage.setItem(key, val); | |
| localStorage.setItem(key + '.timeout', now * timeout); | |
| }, |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import sys | |
| from flake8.run import git_hook | |
| ignore = [ | |
| 'E121', | |
| 'E123', | |
| 'E124', | |
| 'E125', | |
| 'E126', |
This file contains hidden or 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 threading | |
| from django.conf import settings | |
| from django.http import HttpResponseRedirect | |
| # We used our own model to associate users with sites, but could use django.contrib.sites here. | |
| from .models import Network | |
| # List of allowed URLs if user isn't in the network | |
| ALLOWED = [ | |
| u'/accounts/register/', |
This file contains hidden or 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 datetime | |
| import random | |
| from collections import defaultdict | |
| from elasticsearch import Elasticsearch | |
| INDEX = 'test-top-books' | |
| TYPE = 'book-sales' | |
| today = datetime.date.today() |
This file contains hidden or 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 datetime | |
| from elasticsearch import Elasticsearch | |
| INDEX = 'feed' | |
| today = datetime.date.today() | |
| es = Elasticsearch() |
This file contains hidden or 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
| mysql> select a.app_slug, ai.value from addons_installs as ai join addons as a on a.id=ai.addon_id where region=0 order by value desc limit 20; | |
| +---------------------+--------+ | |
| | app_slug | value | | |
| +---------------------+--------+ | |
| | connecta2 | 254311 | | |
| | openwapp | 184414 | | |
| | facebook-1 | 153012 | | |
| | loqui | 115818 | | |
| | whatsapp-firefox-os | 70816 | | |
| | line | 43606 | |
This file contains hidden or 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
| (env)vagrant@precise32:~/src$ pip install --no-deps -U -t vendor/src/elasticsearch-dsl-py -e git+https://github.com/elasticsearch/elasticsearch-dsl-py.git@ea37a0dcefb0f3738a9796a5095f3d93796df259#egg=elasticsearch-dsl-py | |
| You are using pip version 6.0.6, however version 6.0.7 is available. | |
| You should consider upgrading via the 'pip install --upgrade pip' command. | |
| Obtaining elasticsearch-dsl-py from git+https://github.com/elasticsearch/elasticsearch-dsl-py.git@ea37a0dcefb0f3738a9796a5095f3d93796df259#egg=elasticsearch-dsl-py | |
| Updating /home/vagrant/env/src/elasticsearch-dsl-py clone (to ea37a0dcefb0f3738a9796a5095f3d93796df259) | |
| Could not find a tag or branch 'ea37a0dcefb0f3738a9796a5095f3d93796df259', assuming commit. | |
| /home/vagrant/env/lib/python2.6/site-packages/setuptools/dist.py:284: UserWarning: The version specified requires normalization, consider using '0.0.4.dev0' instead of '0.0.4.dev'. | |
| self.metadata.version, | |
| /home/vagrant/env/lib/python2.6/site-packages/pkg_resources/__init__.py:2263: |
This file contains hidden or 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
| { | |
| "highlight": { | |
| "fields": { | |
| "content": {}, | |
| "summary": {} | |
| }, | |
| "order": "score" | |
| }, | |
| "facets": { | |
| "marketplace": { |
This file contains hidden or 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
| Traceback (most recent call last): | |
| File "/home/vagrant/src/kuma/search/tests/test_views.py", line 147, in test_tokenize_camelcase_titles | |
| response = self.client.get('/en-US/search?q=' + q) | |
| File "/home/vagrant/src/vendor/src/django/django/test/client.py", line 439, in get | |
| response = super(Client, self).get(path, data=data, **extra) | |
| File "/home/vagrant/src/vendor/src/django/django/test/client.py", line 244, in get | |
| return self.request(**r) | |
| File "/home/vagrant/src/vendor/src/django/django/test/client.py", line 381, in request | |
| response = self.handler(environ) | |
| File "/home/vagrant/src/vendor/src/django/django/test/client.py", line 84, in __call__ |