Skip to content

Instantly share code, notes, and snippets.

@dijikul
dijikul / Mermaid.config
Created October 23, 2023 05:34
Branching Model Colours
{
"theme": "dark",
"themeVariables": {
"git0": "#aa00aa",
"git1": "#aa0000",
"git2": "#bb7700",
"git3": "#00aa00",
"git4": "#0055aa",
"git5": "#0077aa",
"git6": "#0088aa",
@dijikul
dijikul / combine.py
Last active March 19, 2025 00:20
Combine Multiple PDF's into One (JFK File Analysis)
import os
import PyPDF2
def merge_pdfs(input_directory, output_file):
# Create a PDF merger object
merger = PyPDF2.PdfMerger()
# Get a sorted list of all PDF files in the directory
pdf_files = sorted([f for f in os.listdir(input_directory) if f.lower().endswith('.pdf')])
@dijikul
dijikul / merge_500.py
Last active March 19, 2025 01:28
Merge Multiple PDF's into PDF's under 500 MB each (JFK File Research)
import os
import PyPDF2
def get_pdf_size(pdf_writer):
"""Estimate the size of the PDF by writing it to a temporary file."""
import io
temp_stream = io.BytesIO()
pdf_writer.write(temp_stream)
return temp_stream.tell() / (1024 * 1024) # Convert bytes to MB