Skip to content

Instantly share code, notes, and snippets.

View kastnerp's full-sized avatar
🍋
Focusing

Patrick Kastner kastnerp

🍋
Focusing
View GitHub Profile
@kastnerp
kastnerp / settings.json
Created December 7, 2021 22:03
Windows Terminal settings
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
},
@kastnerp
kastnerp / stack_images.py
Created July 31, 2022 21:31
Stack images with black and white fill color
# inspired by this post https://stackoverflow.com/a/65677170/4876516 by https://stackoverflow.com/users/334346/oleg
import numpy as np
import cv2 as cv
def stack_images(img_list, how, fill_color):
max_height, max_width = 0, 0
padding = 200 # 200
total_height, total_width = padding, padding # padding
mult_by = 0 if fill_color == 'black' else 255
@kastnerp
kastnerp / Export.pptm
Last active August 30, 2023 22:14
Export PowerPoint to individual PDFs with named sections. X.pptx --> X_Section1.pdf, X_Section2.pdf
Sub ExportSectionsToPDF()
Dim pptPresentation As Presentation
Dim tmpPresentation As Presentation
Dim slideCount As Integer
Dim i As Integer
Dim sectionCount As Integer
Dim sectionName As String
Dim sectionStart As Integer
Dim filePath As String
Dim baseFileName As String
@kastnerp
kastnerp / ExportPPTXtoPDF.vba
Last active October 6, 2023 14:10
Export PPTX to PDF | Macro
Sub ConvertToPDFHighQuality()
Dim pdfFileName As String
Dim activePresentationPath As String
' Get the full path of the active presentation
activePresentationPath = ActivePresentation.FullName
' Create a PDF filename based on the original PowerPoint filename
pdfFileName = Replace(activePresentationPath, ".pptx", "_HighQuality.pdf") ' Make sure to replace .pptx with .pptm if macro is saved with presentation
pdfFileName = Replace(pdfFileName, ".pptm", "_HighQuality.pdf")