Skip to content

Instantly share code, notes, and snippets.

View glenn-jocher's full-sized avatar
😃
You Only Live Once

Glenn Jocher glenn-jocher

😃
You Only Live Once
View GitHub Profile
@glenn-jocher
glenn-jocher / ios_app_store_preview_image_resizer.py
Last active February 11, 2024 19:15
iOS App Store Preview Image Resizer
"""
iOS App Store Preview Image Resizer
This script provides functionality to resize images for iOS app store previews. It offers two modes for resizing:
- "pad": This mode will pad the image with white space to fit the target dimensions without cropping.
- "crop": This mode will crop the image to match the target aspect ratio, then resize it to the exact target dimensions.
Usage:
- Modify the `input_dir` variable to point to the directory containing the images you want to resize.
- The script will create output directories named with the target dimensions and the device name.
"""
This script recursively scans Python files within a specified directory to identify functions and classes
that lack docstrings.
Features:
- Can navigate deeply nested directory structures to analyze all `.py` files.
- Allows for specific directories (like `venv` or `runs`) to be excluded from the scan.
- For each missing docstring, the script outputs the file path and the specific function or class declaration.
- Provides a summary count of total functions/classes analyzed, how many have docstrings, and how many are missing them.
- Offers an overview of the number of missing docstrings categorized by the top-level directory.
@glenn-jocher
glenn-jocher / analyze_python_files.py
Last active October 8, 2023 13:14
Analyze Python Files
"""
Python Files Analyzer
This script analyzes Python files in a given GitHub repo, excluding specified sub-directories.
It counts and reports the following for each file:
- Total number of characters
- Total number of words
- Total number of lines
- Total number of functions (based on the 'def' keyword)
- Total number of classes (based on the 'class' keyword)
@glenn-jocher
glenn-jocher / find_broken_links.py
Last active March 27, 2023 01:11
Find Broken Links in Repo Issues/PRs