Skip to content

Instantly share code, notes, and snippets.

View serjflint's full-sized avatar

Sergei Iakhnitskii serjflint

  • Philadelphia, PA
View GitHub Profile
@serjflint
serjflint / pyproject.toml
Created July 24, 2025 13:56
backend-py3 config
[tool.ruff]
target-version = "py312"
line-length = 120
extend-exclude = [
]
namespace-packages = [
]
src = [
]
@serjflint
serjflint / merge.py
Created July 24, 2025 13:38
Merge your rules with proposed
import tomllib
import pathlib
FILE = pathlib.Path('~/pyproject.toml').expanduser()
with FILE.open(mode='rb') as f:
conf = tomllib.load(f)
enabled = conf['tool']['ruff']['lint']['select']
@serjflint
serjflint / result.txt
Created July 24, 2025 13:35
Pylint rules available in ruff
1. anomalous-backslash-in-string (code: W605)
2. assert-on-string-literal (code: PLW0129)
3. assert-on-tuple (code: F631)
4. await-outside-async (code: PLE1142)
5. bad-classmethod-argument (code: N804)
6. bad-docstring-quotes (code: Q002)
7. bad-dunder-name (code: PLW3201)
8. bad-format-string (code: F521)
9. bad-indentation (code: E111)
10. bad-open-mode (code: PLW1501)
@serjflint
serjflint / scratch.py
Created July 24, 2025 13:34
Get pylint rules available in ruff
import subprocess
pipeline = [
'curl https://api.github.com/repos/astral-sh/ruff/issues/970',
'jq -r .body',
"grep -F '[x]'",
"grep -v '\~'",
]
cmd = " | ".join(pipeline)
available = {}
@serjflint
serjflint / err.txt
Created September 21, 2024 23:45
Mypy ternary
main.py:3: error: No overload variant of "max" matches argument types "float", "None" [call-overload]
main.py:3: note: Possible overload variants:
main.py:3: note: def [SupportsRichComparisonT] max(SupportsRichComparisonT, SupportsRichComparisonT, /, *_args: SupportsRichComparisonT, key: None = ...) -> SupportsRichComparisonT
main.py:3: note: def [_T] max(_T, _T, /, *_args: _T, key: Callable[[_T], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]) -> _T
main.py:3: note: def [SupportsRichComparisonT] max(Iterable[SupportsRichComparisonT], /, *, key: None = ...) -> SupportsRichComparisonT
main.py:3: note: def [_T] max(Iterable[_T], /, *, key: Callable[[_T], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]) -> _T
main.py:3: note: def [SupportsRichComparisonT, _T] max(Iterable[SupportsRichComparisonT], /, *, key: None = ..., default: _T) -> Union[SupportsRichComparisonT, _T]
main.py:3: note: def [_T1, _T2] max(Iterable[_T1], /, *, key: Callable[[_T1], Union[SupportsDunderLT[Any], S
@serjflint
serjflint / ruff_missing_pylint.md
Created August 19, 2024 20:29
Currently missing pylint rules in ruff
  • access-member-before-definition / E0203
  • anomalous-unicode-escape-in-string / W1402
  • arguments-out-of-order / W1114
  • arguments-renamed / W0237
  • attribute-defined-outside-init / W0201
  • bad-builtin / W0141
  • bad-chained-comparison / W3601
  • bad-except-order / E0701
  • bad-file-encoding / C2503
  • bad-indentation / W0311
@serjflint
serjflint / ruff_missing_pylint.py
Last active August 19, 2024 20:34
Get missing pylint rules for ruff
import subprocess
pipeline = [
'curl https://api.github.com/repos/astral-sh/ruff/issues/970',
'jq -r .body',
"grep -F '[ ]'",
"grep -v '\~'",
]
cmd = " | ".join(pipeline)
missing = {}
@serjflint
serjflint / animecards_v35.lua
Created August 4, 2024 11:26
Fixed macOS audio: mp3 to m4a
------------- Instructions -------------
-- -- Video Demonstration: https://www.youtube.com/watch?v=M4t7HYS73ZQ
--
-- -- Open clipboard inserter https://anacreondjt.gitlab.io/docs/texthooker/
-- -- Open your anime with japanese subtitles in MPV
-- -- Wait for unknown word and add it to anki through yomichan
-- -- Select all the subtitle lines you wish to add to the card.
-- -- Ctrl + c
-- -- Tab back to MPV and Ctrl + v
-- -- Done. The lines, their respective Audio and the current paused image
@serjflint
serjflint / build.out.txt
Created July 20, 2024 15:41
Zig linking error against Mac OS target
data/environment/arc_None_res6690794553:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/Berkanavt/bin/scripts" VSLANG="1033" ZERO_AR_DATE="1" "/home/sandbox/.cache/cargo-zigbuild/0.19.1/zigcc-x86_64-apple-darwin-1c41.sh" "-arch" "x86_64" "-m64" "/tmp/rustcmNzciC/symbols.o" "/build/ruff/target/x86_64-apple-darwin/release/deps/ruff-819e5380c37c2ce4.2jag2ek1hu4h3y1.rcgu.o" "/build/ruff/target/x86_64-apple-darwin/release/deps/ruff-819e5380c37c2ce4.addr2line-49f48c8353cb63cf.addr2line.7b72c2b7a73e3fb3-cgu.0.rcgu.o.rcgu.o" "/build/ruff/target/x86_64-apple-darwin/release/deps/ruff-819e5380c37c2ce4.adler-52c973eaba43f28d.adler.7d99f3e84a1eecf-cgu.0.rcgu.o.rcgu.o" "/build/ruff/target/x86_64-apple-darwin/release/deps/ruff-819e5380c37c2ce4.ahash-e7cfbcea473bf07e.ahash.17001e649140c23e-cgu.0.rcgu.o.rcgu.o" "/build/ruff/target/x86_64-apple-darwin/release/deps/ruff-819e5380c37c2ce4.ahash-e7cfbcea473bf07e.ahash.17001e649140c23e-cgu.1.rcgu.o.rcgu.o" "/build/ruff/target/x86_64-apple-darwin/release/deps/ruff-819e
@serjflint
serjflint / scratch.py
Created October 29, 2023 23:33
bench json
import json
import orjson
import pickle
import time
import contextlib
DATA = []
@contextlib.contextmanager