Skip to content

Instantly share code, notes, and snippets.

View sethmlarson's full-sized avatar
🛡️

Seth Larson sethmlarson

🛡️
View GitHub Profile
@sethmlarson
sethmlarson / elasticsearch-orjson-serializer.py
Last active March 11, 2024 10:08
JSON serializer for Elasticsearch Python client that uses the 'orjson' library for performance
"""JSON serializer for Elasticsearch Python client that
uses the 'orjson' library for performance.
https://github.com/ijl/orjson
"""
# Implement the Serializer.loads() and .dumps() APIs w/ orjson:
import orjson
from elasticsearch import SerializationError, JSONSerializer
@sethmlarson
sethmlarson / urllib3-2.7.x-downloads.md
Created March 14, 2020 17:20
urllib3 2.7.x Downloads
Python Version # of Downloads % of 2.7.x Downloads % of All Downloads
<2.7.9 133029 11.84% 4.06%
>=2.7.9 990229 88.16% 30.21%
2.7.x 1123258 100% 34.27%
All 3277817 N/A 100%
  • This data was gathered from the PyPI dataset for March 11, 2020.
@sethmlarson
sethmlarson / yahoo-http2-issue.py
Last active January 28, 2020 20:28
Code that reproduces Yahoo's HTTP/2 issue.
"""
Code that reproduces Yahoo's HTTP/2 issue.
Requires you to run `python -m pip install h2` before executing.
Example output:
```
Testing 'google.com' with 'send_unknown_setting=False'...
Result: <ResponseReceived stream_id:1, headers:[(b':status', b'301'), (b'location', b...

Keybase proof

I hereby claim:

  • I am sethmlarson on github.
  • I am sethmlarson (https://keybase.io/sethmlarson) on keybase.
  • I have a public key whose fingerprint is EDD5 6765 A9D8 4653 CBC8 A134 51B0 6736 1740 F5FC

To claim this, I am signing this object: