Skip to content

Instantly share code, notes, and snippets.

View 2af's full-sized avatar

Anton Frolov 2af

  • Georgia
View GitHub Profile
@2af
2af / levenshtein.py
Created July 22, 2024 12:31
Levenshtein (editor) distance weighted.
import Levenshtein
def levenshtein(s1: str, s2: str) -> float:
'''
0.0 means perfect match
0.1 very possible match
0.2 less possible match
0.3 likely not a match
'''
def processor(_string: str) -> str:
_string = _string.upper()
@2af
2af / pip-freeze.sh
Created June 27, 2024 10:16
Better pip freeze
#!/bin/bash
#
# Don't forget to run: chmod +x pip-freeze.sh
#
# This script is used to generate a list of installed Python packages and their versions using the `pip freeze` command.
# It is typically used to create a requirements.txt file for a Python project, which can be used to recreate the exact
# environment with the same package versions.
#
# Usage: ./pip-freeze.sh
#