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 ResponseHandler: | |
| def __init__(callback): | |
| self.counter = 0 | |
| self.callback = callback | |
| def start: | |
| self.counter += 1 # lock | |
| def _on_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
| { | |
| "name": "Google+", | |
| "description": "Google Plus", | |
| "version": "1.0", | |
| "icons": { | |
| "128": "128.png" | |
| }, | |
| "app": { | |
| "urls": [ | |
| "https://plus.google.com/" |
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
| $ mkdir ~/src/google_plus | |
| $ vim ~/src/google_plus/manifest.json |
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
| 09-20 19:19:11 ERROR log.error:36 - -*- settings.PLAN_FEATURES -*- | |
| 09-20 19:19:11 ERROR log.error:36 - {None: ['oembed', 'preview', 'objectify', 'objectify_two', 'iframe', 'safe-browse', 'analytics', 'mobile', 'email-support', 'no-strict', 'feature_info', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two', u'oembed', u'preview', u'objectify', u'objectify_two |
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
| def process(log): | |
| api_key, urls, status = parse(log) | |
| if status in (200,404): | |
| rounded_timestamp = round(log.timestamp) | |
| url_ids = hash_urls(urls) | |
| customer_id = get_customer_id(api_key) | |
| zkey = "hourly::$customer_id::$rounded_timestamp" |
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
| # Cassandra YAML generated from previous config | |
| # Configuration wiki: http://wiki.apache.org/cassandra/StorageConfiguration | |
| cluster_name: 'x Cluster' | |
| auto_bootstrap: true | |
| binary_memtable_throughput_in_mb: 256 | |
| authenticator: org.apache.cassandra.auth.AllowAllAuthenticator | |
| column_index_size_in_kb: 128 | |
| commitlog_directory: /var/lib/cassandra/commitlog | |
| commitlog_rotation_threshold_in_mb: 128 |
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
| 0 98176 46 8795688 30 8795688 30 str | |
| 1 49763 23 4389216 15 13184904 45 tuple | |
| 2 6009 3 3188952 11 16373856 56 dict (no owner) | |
| 3 779 0 1870856 6 18244712 62 dict of module | |
| 4 12633 6 1515960 5 19760672 67 types.CodeType | |
| 5 1650 1 1487032 5 21247704 72 type | |
| 6 12277 6 1473240 5 22720944 77 function | |
| 7 1649 1 1140632 4 23861576 81 dict of type | |
| 8 662 0 725264 2 24586840 84 dict of class | |
| 9 3334 2 642096 2 25228936 86 list |
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/python | |
| import os | |
| import tempfile | |
| import tornado.httpclient | |
| import tornado.curl_httpclient | |
| import tornado.ioloop | |
| class HttpDownload(object): | |
| def __init__(self, url, ioloop): |
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 requests | |
| import sys | |
| for i in range(1,10000): | |
| response = requests.post('http://apply.embed.ly/1', data={'answer': str(i)}) | |
| if response.status_code == 302: | |
| print i | |
| sys.exit(0) |
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
| user www-data; | |
| worker_processes 8; | |
| error_log /var/log/nginx/error.log; | |
| pid /var/run/nginx.pid; | |
| worker_rlimit_nofile 20240; | |
| events { | |
| worker_connections 20240; | |
| use epoll; |