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 json | |
import os | |
import re | |
from sys import argv | |
def get_kitty_theme(): | |
with open(os.getenv('HOME') + '/.config/kitty/current-theme.conf', 'r') as f: | |
data = f.read() | |
return data |
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
#!/usr/bin/env/python3 | |
# Convert Bitwarden CSV export to pass format | |
import pandas | |
import os | |
import sys | |
import subprocess | |
# Check for correct number of arguments |
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
#!/usr/bin/env python3 | |
# Reorder m3u playlist files with fzf | |
import os | |
import sys | |
import subprocess | |
from time import sleep | |
# Get the path to the m3u file | |
if len(sys.argv) == 2: |
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
# This is my (tarneaux's) implementation of the Levenshtein and Damerau-Levenshtein distances, | |
# in a recursive and non-optimized manner based on the formulas on Wikipedia. | |
# For more complete and/or optimized versions of them see: | |
# - https://github.com/TheAlgorithms/Python/blob/master/strings/levenshtein_distance.py | |
# - https://github.com/TheAlgorithms/Python/blob/master/strings/damerau_levenshtein_distance.py | |
# See https://en.wikipedia.org/wiki/Levenshtein_distance | |
def levenshtein(s1, s2): | |
if len(s1) == 0: | |
return len(s2) |