ATTR_ACCESS:
Testing with 10000 repeats, result is average of 10 tests:
>>> NewEnum.foo # 0.6069349023270748 ms
<NewEnum.foo: 1>
>>> OldEnum.foo # 4.5089948174334005 ms
<OldEnum.foo: 1>
This file contains 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
print("Initializing variables") | |
import requests | |
from settings import token | |
import time | |
tlgrm_url = "https://api.telegram.org/bot{}/".format(token) | |
cryptonator_url = "https://api.cryptonator.com/api/ticker/" | |
greeting = 'Привет, я умею показывать текущий курс криптовалют. Отзываюсь на команды /btc и /eth' | |
offset = 0 |
This file contains 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
from dataclasses import dataclass | |
from enum import Enum | |
from timeit import timeit | |
from typing import NamedTuple | |
from pydantic import BaseModel | |
from pydantic.dataclasses import dataclass as pydantic_dataclass | |
class Model(BaseModel): |
This file contains 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
import unittest | |
def find_longest_unique_substring(string: str) -> int: | |
""" | |
Returns length of the longest substring of unique characters | |
""" | |
max_length = 0 | |
current_substr_chars = set() | |
start_index = leading_index = 0 |
This file contains 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
ATTR_ACCESS: | |
Testing with 1000000 repeats: | |
>>> Qrator.FOO # 0.04096488799999998 seconds | |
<Qrator.FOO: FOO> | |
>>> BuiltinPatched.FOO # 0.038564896999999654 seconds | |
<BuiltinPatched.FOO: 'FOO'> |
This file contains 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
import inspect | |
from functools import partial | |
from typing import Type, Literal, Callable, Dict, TypeVar, List | |
from fastapi import APIRouter, Depends | |
# import your database base model here | |
# from db_model import BaseDBModel | |
# this part is a bit outdated since you can now use SQLModel |
Huge thanks to LambdAurora for his Recommended OptiFine alternatives on Fabric gist.
- Download and install Fabric
- Download any mods from list below and put them in
.minecraft/mods
folder
All mods in this list are compatible with each other, unless it stated otherwise
This file contains 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
# copied from https://github.com/tulir/mautrix-telegram/blob/master/mautrix_telegram/util/parallel_file_transfer.py | |
# Copyright (C) 2021 Tulir Asokan | |
import asyncio | |
import hashlib | |
import inspect | |
import logging | |
import math | |
import os | |
from collections import defaultdict | |
from typing import Optional, List, AsyncGenerator, Union, Awaitable, DefaultDict, Tuple, BinaryIO |
This file contains 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
input_file=in.mp4 | |
output_file="${input_file%%.*}"-fragment."${input_file##*.}" | |
subs_file= # can be srt file or mkv container with subtitles | |
start_from= | |
stop_at= | |
duration= | |
# delete lines below that contain empty optional variables from above before use | |
# if duration is specified, '-to' or 'stop_at' is ignored | |
ffmpeg \ |
This file contains 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
from collections.abc import Sequence | |
from functools import cached_property | |
from typing import Any | |
from typing import ClassVar | |
from typing import LiteralString | |
from uuid import UUID | |
from uuid_utils import uuid7 | |
ALPHABET = "0123456789abcdefghjkmnpqrstvwxyz" |
OlderNewer