Skip to content

Instantly share code, notes, and snippets.

View ronknight's full-sized avatar

ronknight ronknight

View GitHub Profile
@ronknight
ronknight / InsertImageToExcel.xls
Created February 5, 2025 19:47
Excel formula to add image to cell
'require link on column A
=IMAGE(@a:a, "Sample Image")
@ronknight
ronknight / InsertImagesForAllRows.xlsm
Created February 5, 2025 19:44
Macro to Insert Images For All Rows
' Require Item numbers on Column A
' Enter base path when prompted
Sub InsertImagesForAllRows()
Dim ws As Worksheet
Dim imgPath As String
Dim imgCell As Range
Dim lastRow As Long
Dim i As Long
Dim basePath As String
@ronknight
ronknight / ExtractItemNumbers.xlsm
Created February 5, 2025 19:40
Macro to get all item numbers from 4sgm URL
' Require 4sgm item numbers on column A
' Require URL with 100 per page parameter
' Enter URL when prompted
Sub ExtractItemNumbers()
Dim ie As Object
Dim html As Object
Dim skuElements As Object
Dim skuElement As Object
@ronknight
ronknight / ConsoleHost_history.txt
Created December 19, 2024 23:59
Clear Terminal History Windows 11
C:\Users\YOUR_USERNAME\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
pip freeze > requirements.txt
@ronknight
ronknight / git_remove_env
Last active May 29, 2024 19:38
remove .env from git and history
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch .env" HEAD
git push --force
@ronknight
ronknight / whitepng2transparentpng.bat
Created May 20, 2024 22:39
convert png with white background to png tranparent background
"C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe" convert -quiet -background none -flatten -transparent white 4sgmlogo.png 4sgmlogo.png
@ronknight
ronknight / trimpng.bat
Created May 20, 2024 22:37
trim all sides of transparent png
"C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe" 94196.png -trim +repage 94196.png
@ronknight
ronknight / tif2jpg-all-layers.bat
Created May 20, 2024 22:36
extract all tiff layer separately and convert to jpg
"C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe" 46783.tif -background white -alpha remove 46783.jpg
@ronknight
ronknight / tif2jpg.bat
Created May 20, 2024 22:35
flatten tif and convert to jpg
"C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\magick.exe" 46783.tif -background white -flatten 46783.jpg