Skip to content

Instantly share code, notes, and snippets.

Avatar

Hynek Schlawack hynek

View GitHub Profile
View attrs-20-1-0.md

attrs 20.1.0 released!

I’m thrilled to finally present attrs 20.1.0 with the following changes:

  • bug fixes
  • performance improvements

JUST KIDDING!

This release is HUGE and I'm stoked we can finally get it to you! It’s the result of more than a year of development and not only does it come with many great features that users desired for a long time, it also lays the foundation for the future evolution of this package.

@hynek
hynek / Prepositions.md
Last active Aug 31, 2019
Why English is Difficult vol. 42
View Prepositions.md

From “Simply English – An A to Z of Avoidable Errors” by Simon Heffer:

Here are some of the most common mistakes with the choice of prepositions: they are often made when a demotic usage seeps into the consciousness of supposedly educated people. A person is absorbed in a task, not by it; but liquid may be absorbed by a sponge. One acquiesces in something, not with it, and one connives at something, not in it. One aims at something, not for it. One becomes angry with someone, not at him. One is ashamed of bad behaviour, not by it. A decision is between one thing and another, not one thing or another. One is bored by or with something, never of it. Something is different from something else, not to it or, even more abominable, than it. One is disgusted with something, not by it. One becomes fed up with things, not of them. Something is identical to something else, not with it. One inculcates something on somebody, one does not inculcate somebody with something;

View keybase.md

Keybase proof

I hereby claim:

  • I am hynek on github.
  • I am hynek (https://keybase.io/hynek) on keybase.
  • I have a public key ASDkAwIXkdnAy7LSXIpEzfF8oNCnq-L0lkU5qk1QwZIyNwo

To claim this, I am signing this object:

@hynek
hynek / Example Usage
Last active Nov 26, 2016
PoC of using attrs’s upcoming metadata feature for using declarative application configuration from env variables including envconsul’s HashiCorp Vault support.
View Example Usage
$ env APP_ENV=dev APP_PROMETHEUS_PORT=7000 SECRET_WHOIS_DEV_APP_PROMETHEUS_CONSUL_TOKEN=abc python app.py
WhoisConfig(env='dev', prometheus=Prometheus(address='127.0.0.1', port='7000', consul_token='abc'))
@hynek
hynek / gunicorn_callbacks_for_worker_id.py
Last active Nov 20, 2020
This is an attempt to emulate uWSGI’s uwsgi.worker_id() that ensures that I have worker IDs from 1…--workers which is useful in logging and instrumentation where changing PIDs are annoying.
View gunicorn_callbacks_for_worker_id.py
import os
def on_starting(server):
"""
Attach a set of IDs that can be temporarily re-used.
Used on reloads when each worker exists twice.
"""
server._worker_id_overload = set()
View Churchill on Brevity.md

A memorandum from Winston Churchill to the War Cabinet from 1940-08-09. Originally seen in https://twitter.com/Oliviersmith/status/701151794001477633 and typed up for accessibility reasons.

Brevity

To do our work, we all have to read a mass of papers. Nearly all of them are far too long. This wastes time, while energy has to be spent in looking for the essential points.

I ask my colleagues and their staffs to see to it that their Reports are shorter.

  1. The aim should be Reports which set out the main points in a series of short, crisp paragraphs.
  2. If a Report relies on detailed analysis of some complicated factors, or on statistics, these should be set out in an Appendix.
View CCCC.rst

Contributor Covenant Code of Conduct

Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

Our Standards

View gist:9408013
-----BEGIN PGP MESSAGE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
owGbwMvMwMG4TtVMqT7zYyPj6QNPkhiCJbv8qpWS8lMqlayqlbJTwVRaZl56alFB
UWZeiZKVUrJRooFJmoVZYnKqkUViSnKahaF5SlKSeWKqkamxmZGReZqZZZqhhaGS
jlJGfjFIB9CYpMTiVL3MfKAYkBOfmQIUdXSFqnczs3SDqC8FS6QlJxqZGaeamZuY
mySlGZonpqQaWZolmyWbmhkmphgYgBQWpxblJeamAlVnVOalZivV6igBhcoyk1NB
DoZKpWeWZJQm4VBeUlkA4penJsVDdcYnZealAL0K1FCWWlScmZ+nZGUIVJlckgnS
amhsaWJoYWRubKyjlFpRkFmUGp8JUmFqbmZhAAQ6SgVFqWWgAEqxTEyxSDFPTDOw
SDM3TDROM00zTjYzs0hOSzNIMTQzskhJM0tLTDY0NzJKTjYyszBJSkkzMTA2MEpJ
View gist:9384846
mktmpenv
New python executable in /Users/hynek/.virtualenvs/6a3208995e966073/bin/python
Installing setuptools, pip...done.
«6a3208995e966073» ~
↪︎ pip install cryptography
DEPRECATION: --no-install, --no-download, --build, and --no-clean are deprecated. See https://github.com/pypa/pip/issues/906.
Downloading/unpacking cryptography
Using download cache from /Users/hynek/.pip/cache/https%3A%2F%2Fpypi.vm.ag%2Froot%2Fpypi%2F%2Bf%2Ff002a442c8c5c7463bf8d2f11f6c3128%2Fcryptography-0.2.2.tar.gz
Running setup.py (path:/Users/hynek/.virtualenvs/6a3208995e966073/build/cryptography/setup.py) egg_info for package cryptography
no previously-included directories found matching 'documentation/_build'
@hynek
hynek / gist:8296975
Last active Jan 2, 2016
Python packages that are keeping me from deploying more Python 3 application.
View gist:8296975

Preamble

This is not a wall of shame but an attempt to get an overview what’s hindering the adoption of a really nice programming language (some warts non-withstanding).

Feel free to chime in or release your own list so we get a better picture. Maybe you’ll even realize you have everything you need by now.

Blockers

  • idna (is ported as of 0.3, the trove identifiers are wrong ATM)
  • python-ldap (there are two 1 2 pyldaps now that seem to support Python 3, only one is on PyPI tho; dunno how usable they are)
You can’t perform that action at this time.