Skip to content

Instantly share code, notes, and snippets.

@sobolevn
sobolevn / setup.cfg
Created May 31, 2023 14:26
flake8 configuration example
[flake8]
# Base flake8 configuration:
# https://flake8.pycqa.org/en/latest/user/configuration.html
format = wemake
show-source = true
statistics = false
doctests = true
# darglint configuration:
# https://github.com/terrencepreilly/darglint
import ast
import argparse
import os
import sys
import tokenize
from dataclasses import dataclass
from typing import Final, TypeAlias
_AnyFunction: TypeAlias = ast.FunctionDef | ast.AsyncFunctionDef
import gc
import os
import re
import subprocess
import time
from tabulate import tabulate
_HOST = 'http://127.0.0.1:8000'

Правила сообщества PythoNN

Адрес чата: t.me/pytho_nn

О чём можно

  • мероприятия и проекты сообщества
  • Python и сопутствующая экосистема
  • новости, которые хотя бы косвенно связаны с Python
  • мир разработки вокруг
# /// script
# requires-python = ">=3.14"
# dependencies = [
# "pyperf",
# "httpx",
# ]
# ///
#
# To run `Threading with NoGIL`, first build Python with:
# `./configure --with-pydebug --disable-gil && make`
>>> def other(x, y):
... res = None
... try:
... res = x / y
... except ZeroDivisionError:
... res = 0
... finally:
... print(res)
...
>>> import dis
@sobolevn
sobolevn / iptables.sh
Created March 9, 2017 14:15 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@sobolevn
sobolevn / rules.md
Created September 14, 2023 11:12
Правила MoscowPython Discord

Правила сообщества MoscowPython Discord

Адрес чата: https://discord.gg/tNxbPpDchQ

О чём можно

  • мероприятия и проекты сообщества
  • Python и сопутствующая экосистема
  • новости, которые хотя бы косвенно связаны с Python
  • мир разработки вокруг

Intro

Working with open-source software is now a regular part of our lives. We can now say that open-source software has major market shares in almost all fields.

Verifying what is going on inside an application by yourself is especially important in DeFi, where transparency and openness are key philosophical factors. For example, any third-party security researcher can audit and verify the state of security of any open-source project. This creates a lot of trust among end users and other developers.

Everyone can help to improve the software they use if needed, which creates a connection between developers and forms a community around a piece of software.