Skip to content

Instantly share code, notes, and snippets.

~ $ go/bin/hey http://localhost:57767
Summary:
Total: 40.0799 secs
Slowest: 10.0952 secs
Fastest: 0.0012 secs
Average: 0.8415 secs
Requests/sec: 4.9900
Total data: 1488 bytes
jaraco@vdev-jaraco:~$ hey http://localhost:38870
Summary:
Total: 40.0206 secs
Slowest: 10.0754 secs
Fastest: 0.0006 secs
Average: 1.1396 secs
Requests/sec: 4.9974
Total data: 1920 bytes
https://gist.github.com/dff4968715f64a2dae4fa8541670930b
__requires__ = ['cherrypy']
import cherrypy
class Server:
@classmethod
def run(cls):
config = {
setuptools feature/pyopenssl-fallback $ python3.5 -m pip-run twisted
Collecting twisted
Downloading https://files.pythonhosted.org/packages/5d/0e/a72d85a55761c2c3ff1cb968143a2fd5f360220779ed90e0fadf4106d4f2/Twisted-18.9.0.tar.bz2 (3.1MB)
100% |████████████████████████████████| 3.2MB 7.0MB/s
Complete output from command python setup.py egg_info:
Download error on https://pypi.org/simple/incremental/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:719) -- Some packages may not be found!
Couldn't find index page for 'incremental' (maybe misspelled?)
Download error on https://pypi.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:719) -- Some packages may not be found!
No local packages or working download links found for incremental>=16.10.1
Traceback (most recent call last):
Created temporary directory: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-ephem-wheel-cache-hxoe1j41
Created temporary directory: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-req-tracker-5tiry4h6
Created requirements tracker '/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-req-tracker-5tiry4h6'
Created temporary directory: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-yrwcx99r
Processing /Users/jaraco/p/pypa/pep517
Created temporary directory: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-req-build-xj7pinv9
Added file:///Users/jaraco/p/pypa/pep517 to build tracker '/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-req-tracker-5tiry4h6'
Created temporary directory: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-r66if194
Installing build dependencies: started
Running command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip install --ignore-installed --no-user --pref
@jaraco
jaraco / foo.py
Last active November 28, 2018 17:28
__requires__ = ['pytest-responses', 'pytest']
import requests
def test_paginated_request(responses):
responses.add(
responses.GET,
'https://service.test/api/paginated/',
@jaraco
jaraco / foo.py
Last active November 15, 2018 12:29
import functools
import collections
import cherrypy
class SelectedMethod:
"""
Descriptor allowing a series of handler methods to satisfy
a variety of behaviors based on the request method.
python3statement.github.io master $ gem install jekyll
Fetching: colorator-1.1.0.gem (100%)
Successfully installed colorator-1.1.0
Fetching: http_parser.rb-0.6.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed http_parser.rb-0.6.0
Fetching: eventmachine-1.2.7.gem (100%)
Building native extensions. This could take a while...
Successfully installed eventmachine-1.2.7
Fetching: em-websocket-0.5.1.gem (100%)
query = [{'$lookup': {
'from': 'tasks',
'let': {'target_id': '$ID'},
'pipeline': [
{
'$match': {
'$expr': {
'$eq': ['$TARGET_ID', '$$target_id'],
},
},