- Act professionally
- Treat others as friends and family
- Seek first to understand
- Respect other's opinions though they may differ from your own
- Admit when you're wrong
- Be honest, transparent, and constructive
- Use clear, concise language
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
| # Fire this using gunicorn falcon_gevent_streaming | |
| # and head to 127.0.0.1:8000 in a browser. | |
| # Requirements: | |
| # pip install falcon gevent | |
| import falcon | |
| import gevent | |
| from gevent.queue import Queue |
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 os | |
| import json | |
| import falcon | |
| import mimetypes | |
| from wsgiref import simple_server | |
| from pymongo import MongoClient | |
| from bson.objectid import ObjectId | |
| from bson.json_util import dumps |
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
| """ A CORS middleware for the Falcon Framework <http://falconframework.org/> | |
| """ | |
| __author__ = "Luis Benitez" | |
| __license__ = "MIT" | |
| from falcon import HTTP_METHODS | |
| class CorsMiddleware(object): | |
| """Implements (partially) the Cross Origin Resource Sharing specification |
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
| docker rmi $(docker images -q -f dangling=true) |
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
| # ========================================================================= | |
| # middleware.py | |
| # ========================================================================= | |
| import sqlalchemy.orm.scoping as scoping | |
| class SQLAlchemySessionManager(object): | |
| def __init__(self, session_factory, auto_commit=False): | |
| self._session_factory = session_factory | |
| self._scoped = isinstance(session_factory, scoping.ScopedSession) |
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
| # See also http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/4/ | |
| server_tokens off; | |
| client_max_body_size 4096k; | |
| client_header_timeout 10; | |
| client_body_timeout 10; | |
| keepalive_timeout 10 10; | |
| send_timeout 10; |
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
| # See also: http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/3/ | |
| gzip on; | |
| gzip_disable "msie6"; | |
| gzip_min_length 1100; | |
| gzip_vary on; | |
| gzip_proxied any; | |
| gzip_buffers 16 8k; | |
| gzip_types text/plain text/css application/json application/x-javascript |
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
| # Configuration file for runtime kernel parameters. | |
| # See sysctl.conf(5) for more information. | |
| # See also http://www.nateware.com/linux-network-tuning-for-2013.html for | |
| # an explanation about some of these parameters, and instructions for | |
| # a few other tweaks outside this file. | |
| # Protection from SYN flood attack. | |
| net.ipv4.tcp_syncookies = 1 |
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
| server { | |
| # listen 66.225.195.83; | |
| server_name synchtube.itunix.eu; | |
| access_log /var/log/nginx/access.log; | |
| error_log /var/log/nginx/error.log; | |
| location / { | |
| proxy_pass http://synchtube.itunix.eu:1337; | |
| proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; | |
| proxy_redirect off; |