This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # aproducer.py | |
| # | |
| # Async Producer-consumer problem. | |
| # Challenge: How to implement the same functionality, but no threads. | |
| import time | |
| from collections import deque | |
| import heapq | |
| class Scheduler: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| CIPHERS='ALL:eNULL' | |
| DELAY=${2:-0.1} | |
| SERVER=${1:?usage: $0 <host:port> [delay, default is ${DELAY}s] [ciphers, default is ${CIPHERS}]} | |
| MAXLEN=$(openssl ciphers "$CIPHERS" | sed -e 's/:/\n/g' | awk '{ if ( length > L ) { L=length} }END{ print L}') | |
| echo Using $(openssl version). | |
| declare -A TLSMAP=( [tls1_1]=cipher [tls1_2]=cipher [tls1_3]=ciphersuites ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # myapp/models.py | |
| from django.db import models | |
| class MyModel(models.Model): | |
| class Meta: | |
| abstract = True | |
| def __str__(self): | |
| data = [f'{k}={v!r}' for k, v in self.__dict__.items() if not k.startswith('_')] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # syntax=docker/dockerfile:experimental | |
| FROM python:3.7-slim AS base | |
| # ENV LANG=C.UTF-8 # Sets utf-8 encoding for Python et al | |
| # ENV PYTHONDONTWRITEBYTECODE=1 # Turns off writing .pyc files; superfluous on an ephemeral container. | |
| # ENV PYTHONUNBUFFERED=1 # Seems to speed things up | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| — Да? | |
| — Алё! | |
| — Да да? | |
| — Ну как там с деньгами? | |
| — А? | |
| — Как с деньгами-то там? | |
| — Чё с деньгами? | |
| — Чё? | |
| — Куда ты звонишь? |
OlderNewer