Skip to content

Instantly share code, notes, and snippets.

@gcarothers
gcarothers / requirements.txt
Created November 8, 2017 21:29
Requirements file that causes recursion depth exceeded
alabaster==0.7.10
alembic==0.8.8
amqp==1.4.9
amqplib==1.0.2
anyjson==0.3.3
apache-libcloud==0.17.0
appenlight-client==0.6.14
argh==0.26.1
astroid==1.2.1
avro==1.7.7
<label @json>
# Add a hostname to every record we generate.
<filter **>
type record_transformer
<record>
hostname "#{Socket.gethostname}"
application ${tag_parts[-1]}
</record>
</filter>
def forbid_user_messages(request, user):
"""Provide messaging to users who have an active session and become
disabled for some reason."""
if user.inactive and not request.is_xhr:
# Log out inactive users.
headers = forget(request)
if user.trial_expiration:
error_msg = """Your Lex Machina trial has expired.
Please <a href="mailto:sales@lexmachina.com">contact sales</a>
to subscribe."""
pip install --upgrade 'pip>=1.4.1'
Requirement already up-to-date: pip>=1.4.1 in /home/lex/lib/python2.7/site-packages
pip install --upgrade 'setuptools>=0.8'
Requirement already up-to-date: setuptools>=0.8 in /home/lex/lib/python2.7/site-packages
pip install wheel
Requirement already satisfied (use --upgrade to upgrade): wheel in /home/lex/lib/python2.7/site-packages
pip wheel -w wheelhouse -f wheelhouse -r requirements.txt
ERROR: 'pip wheel' requires setuptools >= 0.8 for dist-info support. To fix this, run: pip install --upgrade setuptools
@view_config(context=Exception)
def exception_view(context, request):
# Check to see if debug toolbar is enabled.
from pyramid.interfaces import ITweens
tweens = request.registry.queryUtility(ITweens)
if tweens:
tween_list = tweens.explicit or tweens.implicit()
tween_names = zip(*tween_list)[0]
if tween_list and 'pyramid_debugtoolbar.toolbar_tween_factory' in\
tween_names:
home / sameroute.views.my_view *
home_again / <unknown> *
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
def hello_world(request):
return Response('Hello %(name)s!' % request.matchdict)
if __name__ == '__main__':
config = Configurator()
config.add_route('hello', '/hello/{name}')
def engine_from_environ(prefix, settings, application_name=None):
"""Setup an SQLAlchemy engine with overrides from environment.
Maps KEYS_LIKE_THIS to keys.like.this"""
env_prefix = prefix.replace('.', '_').upper()
for env in os.environ:
if env.startswith(env_prefix):
key = env.replace('_', '.').lower()
settings[key] = os.environ[env]
if application_name is not None:

2015-04-10

  • Pyramid Booth
  • What can programmers learn from pilots?
  • Hyperactive: HTTP/2 and Python
  • Lunch
  • Pyramid Booth
  • My Python's a little Rust-y
  • Stop Sucking Me Into Your Drama: A Personal Appeal For Loose Coupling
  • Break
  • Fire your supervisord: running Python apps on CoreOS

Keybase proof

I hereby claim:

  • I am gcarothers on github.
  • I am gavincarothers (https://keybase.io/gavincarothers) on keybase.
  • I have a public key whose fingerprint is 4EF1 6144 8024 2855 C8E4 F4F8 BFD9 CBF6 4483 588E

To claim this, I am signing this object: