Skip to content

Instantly share code, notes, and snippets.

@Red-Satori
Red-Satori / search_files.py
Created December 30, 2023 15:07
Search TFM subtitle files using Python
import os
import re
import sys
FILE_MATCH = "tfm-"
FILE_EXTENSTIONS = ('.srt', '.md', '.txt', '.mp3', '.mp4') # Add '.mp3' and '.mp4' extensions
DIRECTORY = os.getcwd()
if not sys.argv or len(sys.argv) < 2:
print("You must pass search args")
@Red-Satori
Red-Satori / search_one_file.py
Last active December 30, 2023 15:31
Count TFM occurrences in a file and print them
import sys
import re
if len(sys.argv) != 3:
print("Usage: python3 search_one_file.py <srt_file_path> <search_string>")
sys.exit(1)
srt_file_path = sys.argv[1]
search_string = sys.argv[2]
@Red-Satori
Red-Satori / calculate_smv.py
Created November 7, 2022 13:06
Python Script to Calculate a Man's SMV
#!/usr/bin/python3
# -*- coding: utf-8 -*-
inputs = ['face', 'height', 'body', 'money', 'p-length', 'intelligence']
weights = [5, 3, 2, 2, 2, 1]
# Courtesy of Wheat Waffles
# https://www.youtube.com/watch?v=kZqNkkX7oeE
def calculate_smv():