Skip to content

Instantly share code, notes, and snippets.

View dp-quant's full-sized avatar

Dmytro Podoprosvietov dp-quant

View GitHub Profile
@dp-quant
dp-quant / client.py
Created August 31, 2020 12:09 — forked from zapstar/client.py
Python Asyncio SSL client and server examples
#!/usr/bin/env python3
import asyncio
import ssl
@asyncio.coroutine
async def echo_client(data, loop):
ssl_ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_ctx.options |= ssl.OP_NO_TLSv1
@dp-quant
dp-quant / customize-save-in-django-admin-inline-form.org
Created January 29, 2020 08:22 — forked from shymonk/customize-save-in-django-admin-inline-form.org
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):
@dp-quant
dp-quant / geventmongo.py
Last active September 20, 2015 17:41 — forked from gwik/geventmongo.py
PyMongo >=2.0 pool for gevent
# Copyright 2011 10gen
#
# Modified by Antonin Amand <[email protected]> to work with gevent.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#