Skip to content

Instantly share code, notes, and snippets.

View adelhamad's full-sized avatar

Adel Hamad adelhamad

View GitHub Profile
@adelhamad
adelhamad / download-youtube-videos-as-mp3.js
Last active December 5, 2025 05:49
download-youtube-videos-as-mp3.js
/**
* Requirements:
* brew install yt-dlp ffmpeg
*
* Run:
* node download-multi.js
*
* Supports:
* - multiple jobs in parallel
* - friendly job definitions
@adelhamad
adelhamad / delete_folders_except.sh
Last active November 9, 2025 20:30
delete all folder except
for d in */; do
d=${d%/}
if [[ " C243 C244 C250 C262 C276 C281 C287 C290 C302 C307 \
C383 C392 C394 C395 C396 C435 C438 C445 C449 C451 \
C463 C467 C470 C487 C496 " =~ " $d " ]]; then
echo "Keeping $d"
else
echo "Deleting $d"
rm -rf "$d"
fi
@adelhamad
adelhamad / bulk-image-compressor-mac.sh
Last active October 20, 2025 00:56
bulk-image-compressor-mac.sh
#!/bin/zsh
# bulk-image-compressor-mac.sh
#
# Description:
# Run this directly in Terminal from inside the folder containing your images.
# It recursively converts all images (any format) to JPG, then compresses and resizes them
# until each image is below ~250 KB, using only macOS built-in 'sips'.
#
# Usage:
# 1. Open Terminal
@adelhamad
adelhamad / kyc.js
Created October 1, 2025 01:15
KYC ID Document Analysis Script with Fraud Detection
/**
* KYC ID Document Analysis Script with Fraud Detection
*
* This script uses Google's Gemini API to analyze ID documents and perform
* KYC fraud detection analysis using only Node.js built-in modules.
*
* Usage: node kyc.js
*/
const https = require('https');