Skip to content

Instantly share code, notes, and snippets.

View jfrobbins's full-sized avatar

Jon Robbins jfrobbins

  • NC
  • 08:17 (UTC -05:00)
View GitHub Profile
@jfrobbins
jfrobbins / pdf_to_png.py
Last active May 5, 2025 20:38
Python script that allows you to export pages from a PDF file to PNG images. The script can be run from the command line, supports exporting specific pages or a range of pages, and includes an option to export all pages. The output images are saved in a directory named after the PDF file (without the extension) within the same directory as the P…
# Filename: pdf_to_png.py
# Summary: Converts specified or all PDF pages to PNG images on macOS, extracting the first non-empty text line as the title for filenames.
# Filenames are structured as <file-name>_pg-<page-number>_<slide-title>.png for better sorting by page number.
# Page numbers are padded with leading zeros based on the total number of pages.
# Usage:
# - Convert all pages: python pdf_to_png.py input.pdf
# - Convert a range (e.g., pages 3-7): python pdf_to_png.py input.pdf --pages 3-7
# - Convert specific pages (e.g., pages 1,3,5): python pdf_to_png.py input.pdf --pages 1,3,5
# Dependencies:
# - pdf2image: Install via `pip install pdf2image`
@jfrobbins
jfrobbins / pyCollapse.py
Created October 9, 2025 13:04
A tool to recursively scan a directory and collapse its contents into a single file. It provides intelligent API and structure parsing for Python files and works generically with any other readable text file, such as C# (.cs), Java, JSON, Markdown, etc. Ideal for creating a comprehensive project overview for AI analysis.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# --- MIT License ---
#
# Copyright (c) 2025 [Jon Robbins]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights