Skip to content

Instantly share code, notes, and snippets.

View star-bits's full-sized avatar

star-bits

View GitHub Profile
@star-bits
star-bits / rename_photos_YYYYMMDD_hhmmss.py
Last active January 10, 2024 11:32
Renames image files by their date taken in YYYYMMDD_hhmmss format followed by the original file name
# install ExifTool from https://exiftool.org
import os
import subprocess
folder_path = '/Users/username/your/folder' # Replace with your folder path
for filename in os.listdir(folder_path):
if filename.lower().endswith(('.png', '.jpg', '.jpeg', '.tiff', '.bmp', '.gif', '.mp4')):
file_path = os.path.join(folder_path, filename)
@star-bits
star-bits / nintendo_switch_screenshots_folder.py
Last active January 10, 2024 11:49
Collect Nintendo Switch screenshot files into one folder
import os
import glob
import shutil
def collect_files(root_dir, target_dir):
if not os.path.exists(target_dir):
os.makedirs(target_dir)
# Find all .jpg and .mp4 files in the subdirectories
for extension in ['jpg', 'mp4']: