Skip to content

Instantly share code, notes, and snippets.

View pleabargain's full-sized avatar
🏠
office

Dennis pleabargain

🏠
office
View GitHub Profile
@pleabargain
pleabargain / Add-CursorEditContextMenu.ps1
Created February 10, 2025 18:57
right click ps1 open with cursor IDE
# Requires administrator privileges to modify registry
#Requires -RunAsAdministrator
# Script to add "Edit with Cursor" context menu for .ps1 files
try {
# Get Cursor installation path
$cursorPath = "$env:LOCALAPPDATA\Programs\cursor\Cursor.exe"
# Verify Cursor exists
@pleabargain
pleabargain / filerenamer.ps1
Created February 8, 2025 08:05
rename a bunch of files, remove white space with powershell
# Get all .docx files in the current directory
$files = Get-ChildItem -Filter "*.docx"
# Check if any files were found
if ($files.Count -eq 0) {
Write-Host "No .docx files found in the current directory."
exit
}
# Display current files
@pleabargain
pleabargain / combinepdf.ps1
Created February 6, 2025 10:42
combine multiple PDFS into one using powershell and qpdf on win11
# PDF Merger Script using QPDF
# This script allows user to select order of PDFs and combines them into a single PDF file
# Requirements: QPDF must be installed on the system
function Get-PdfPageCount {
param (
[string]$pdfPath
)
try {
$pageCount = & qpdf --show-npages $pdfPath 2>&1
@pleabargain
pleabargain / concatenatepdf.ps1
Created February 3, 2025 10:36
powershell script to concatenate PDF into user selected order requires chocolatey and qpdf to be installed
# Check if qpdf is installed
$qpdfCheck = Get-Command qpdf -ErrorAction SilentlyContinue
if (-not $qpdfCheck) {
Write-Host "QPDF is not installed. Please install it using: choco install qpdf"
Write-Host "If you don't have chocolatey installed, visit https://chocolatey.org/install"
exit
}
# Get all PDF files in current directory
$pdfFiles = Get-ChildItem -Path $PWD -Filter "*.pdf"
@pleabargain
pleabargain / prependpdfoneshot.ps1
Created February 3, 2025 10:24
powershell to prepend a name to all PDFs in a directory
# Get the current directory
$currentDir = Get-Location
# Get all PDF files in the current directory
$pdfFiles = Get-ChildItem -Path $currentDir -Filter "*.pdf"
# If no PDF files found, inform user and exit
if ($pdfFiles.Count -eq 0) {
Write-Host "No PDF files found in the current directory."
exit
@pleabargain
pleabargain / powershell-interactively-delete-ollama-models.ps1
Created January 31, 2025 06:48
powershell script to list and then prompt user to delete installed ollama models
# Ollama Model Manager Script
function Show-Models {
$models = ollama list
$index = 0
$models | ForEach-Object {
Write-Host "$($index): $_"
$index++
}
}
@pleabargain
pleabargain / gist:c3018173d740421b0e906db8aa0c939e
Created January 29, 2025 13:58
powershell using magick to zoom in and crop a photo to 2:3 ratio
Get-ChildItem -Path . -File | Where-Object { $_.Name -notmatch '\s' } | ForEach-Object {
$output = Join-Path $_.DirectoryName ($_.BaseName + "_cropped" + $_.Extension)
magick $_.FullName -gravity center -resize 130% -crop 2:3 +repage $output
}
@pleabargain
pleabargain / reduceimageproportion.ps1
Last active January 29, 2025 10:28
automatically reduces images by 10 25 and 50 percent using powershell
# ===================================================================
# Image Resize Function for PowerShell
# ===================================================================
#
# DESCRIPTION:
# This script creates multiple resized versions of images while preserving
# aspect ratios. By default, it creates 10%, 25%, 50%, and 75% versions.
#
# INSTALLATION:
# 1. Save this script as 'install-resize-function.ps1'
@pleabargain
pleabargain / ksa.json
Last active January 28, 2025 07:48
list of cities and towns in alpha for KSA
{
"city": [
"Abha",
"Ad-Dilam",
"Al Artaweeiyah",
"Al Bahah",
"Al Bukayriyah",
"Al Jafr",
"Al Lith",
"Al Majma'ah",
@pleabargain
pleabargain / clineinstructions.md
Created January 28, 2025 07:45
cline instructions with error logging, mermaid diagrams, ISO date

Cline's Memory Bank

You are Cline, an expert software engineer with a unique constraint: your memory periodically resets completely. This isn't a bug - it's what makes you maintain perfect documentation. After each reset, you rely ENTIRELY on your Memory Bank to understand the project and continue work. Without proper documentation, you cannot function effectively.

Memory Bank Files

CRITICAL: If cline_docs/ or any of these files don't exist, CREATE THEM IMMEDIATELY by:

  1. Reading all provided documentation
  2. Asking user for ANY missing information
  3. Creating files with verified information only