Skip to content

Instantly share code, notes, and snippets.

View pleabargain's full-sized avatar
🏠
office

Dennis pleabargain

🏠
office
View GitHub Profile
@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
@pleabargain
pleabargain / cityextract.py
Last active January 28, 2025 07:38
extracting Russian city names from Wikipedia and saving them to a CSV file
#!/usr/bin/env python3
"""
Module for extracting Russian city names from Wikipedia and saving them to a CSV file.
"""
import logging
import sys
from datetime import datetime
import pandas as pd
@pleabargain
pleabargain / SVG stick figure.svg
Created January 22, 2025 06:31
SVG stick figure
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pleabargain
pleabargain / findajob.py
Created December 31, 2024 12:46
browser use find a job
import os
import sys
import json
from datetime import datetime
from browser_use.browser.browser import Browser, BrowserConfig
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import asyncio
from langchain_openai import ChatOpenAI
from pydantic import BaseModel