Skip to content

Instantly share code, notes, and snippets.

View langheran's full-sized avatar
🎧
Automation Ninja 🐱‍👓

Nisim Hurst-Tarrab langheran

🎧
Automation Ninja 🐱‍👓
View GitHub Profile
@langheran
langheran / SetFolderTimestampToNewestFile.reg
Created July 31, 2024 01:05
C:\Users\NisimHurst\Utilities\Autohotkey\SetFolderTimestampToNewestFile\SetFolderTimestampToNewestFile.reg
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\Adjust Timestamp]
[HKEY_CLASSES_ROOT\Directory\shell\Adjust Timestamp\command]
;@="\"c:\\Program Files\\AutoHotkey\\AutoHotkey.exe\" \"x:\\AutoHotkey\\SetFolderTimestampToNewestFile.ahk\" \"%1\""
;If the script is compiled:
@="\"C:\\Users\\NisimHurst\\Utilities\\Autohotkey\\SetFolderTimestampToNewestFile\\SetFolderTimestampToNewestFile.exe\" \"%1\""
@langheran
langheran / SetFolderTimestampToNewestFile.ahk
Created July 31, 2024 01:04
C:\Users\NisimHurst\Utilities\Autohotkey\SetFolderTimestampToNewestFile\SetFolderTimestampToNewestFile.ahk
; SetFolderTimestampToNewestFile.ahk
; by SanskritFritz
; Set a folder's 'modified' date to the timestamp of the newest file it contains.
; The folder name should be given as parameter.
#NoTrayIcon
if 0 <> 1
{
MsgBox The parameter 'folder name' is missing!
@langheran
langheran / sort_id.js
Created July 22, 2024 20:11
C:\Users\NisimHurst\NDS\scripts\queries\sort_id.js
db.getCollection('intents').aggregate([{ $addFields: { _id_date: { $toDate: "$_id" } } }, { $sort: { _id_date:-1 } }])
@langheran
langheran / convert_puml2png.bat
Created July 11, 2024 16:18
C:\Users\NisimHurst\NDS\scripts\convert_puml2png.bat
@echo off
REM Ensure PlantUML jar file path is correct
set PLANTUML_JAR=C:\Bin\plantuml.jar
REM Loop through all .puml files in the current directory
for %%f in (*.puml) do (
echo Converting %%f to PNG...
java -jar "%PLANTUML_JAR%" %%f
)
@langheran
langheran / req.cmd
Created July 10, 2024 18:20
C:\Users\NisimHurst\NDS\scripts\cmds\req.cmd
@echo off
call .\venv\Scripts\activate.bat
pip install -r requirements.txt
@langheran
langheran / youtube_presentation.py
Created June 27, 2024 17:24
C:\Users\NisimHurst\NDS\scripts\extract_presentation_youtube\youtube_presentation.py
# %%
# Importing necessary libraries
import cv2
from skimage.metrics import structural_similarity as ssim
import numpy as np
import os
from pptx import Presentation
from pptx.util import Inches
# %%
@langheran
langheran / trim_pdf_images.ps1
Created June 27, 2024 01:44
C:\Users\NisimHurst\NDS\scripts\trim_pdf_images.ps1
Get-ChildItem ".\" -Filter *.pdf |
Foreach-Object {
$output = $_.BaseName + ".png"
if (Test-Path $output) {
Remove-Item $output
}
convert -density 300 $_.FullName -bordercolor white -border 1x1 -trim +repage -quality 100 -border 50x50 $output
}
@langheran
langheran / convert2ico.bat
Created May 19, 2024 17:10
C:\Users\NisimHurst\NDS\scripts\convert2ico.bat
convert oauth.png -define icon:auto-resize=256,128,64,48,32,16 oauth.ico
@langheran
langheran / kill_drive.ps1
Created May 19, 2024 17:09
C:\Users\NisimHurst\NDS\scripts\kill_drive.ps1
# Function to find and kill processes using the specified drive
function Kill-ProcessUsingDrive {
param (
[string]$DriveLetter
)
# Get the list of processes
$processes = Get-CimInstance -ClassName Win32_Process
# Filter processes that have a handle open on the specified drive
@langheran
langheran / stop_sql.bat
Created May 19, 2024 17:09
C:\Users\NisimHurst\NDS\scripts\stop_sql.bat
net stop MySQL80
net stop MSSQLSERVER
taskkill.exe /IM sqlbrowser.exe /F
taskkill.exe /IM sqlceip.exe /F
taskkill.exe /IM sqlservr.exe /F
taskkill.exe /IM sqlwriter.exe /F