Skip to content

Instantly share code, notes, and snippets.

xcode-select --install
brew install readline xz
from aiohttp import client
a = client.ClientSession()
async def b():
async with a.get('https://videso.rambler.ru', timeout=0.01) as r:
print(await r.text())
import asyncio
asyncio.get_event_loop().run_until_complete(b())
a.close()
@dyus
dyus / field.py
Last active December 4, 2016 09:58
drf Base64Field with optional format
import base64
import binascii
from django.core.files.base import ContentFile
from django.utils import six
from rest_framework.exceptions import ValidationError
from rest_framework.fields import FileField
def get_user_availability(mail, start, end, format=u"Default", time_zone='Europe/Moscow'):
"""
https://msdn.microsoft.com/en-us/library/aa564001(v=exchg.140).aspx
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>