Skip to content

Instantly share code, notes, and snippets.

@MatteoGheza
MatteoGheza / yt_segment_downloader.ps1
Created September 17, 2025 19:21
Download a specific part of a YT video or live streaming with yt-dlp and ffmpeg (without downloading the entire video)
param(
[string]$Url,
[string]$TimestampsFile,
[string]$OutputDir
)
if (-not $Url -or -not $TimestampsFile -or -not $OutputDir) {
Write-Host "Usage: .\download_clips.ps1 -Url <video_url> -TimestampsFile <timestamps.txt> -OutputDir <output_dir>"
exit
}
@MatteoGheza
MatteoGheza / git_log.py
Created June 12, 2025 07:29
Tool to read Git history and search for a list of strings
#!/usr/bin/env python3
import subprocess
import sys
import argparse
from datetime import datetime
import os
# python git_log.py --repo /path/to/repo --strings "redacted_string1" "redacted_string2"
// Go to https://photos.google.com/search/_tra_
javascript:(function(){
let count = 0, maxRuns = 50;
let intervalTime = 800;
function clickCheckboxes(){
let boxes = document.querySelectorAll('div[role="checkbox"][aria-label*="RAW" i]');
let unchecked = 0;
boxes.forEach(e=>{
if(e.getAttribute('aria-checked')!=='true'){
e.click();
@MatteoGheza
MatteoGheza / page_printer.js
Last active May 16, 2025 20:36
Export webpage to PDF using puppeteer even if page height is greater than your screen size
// Vibe-coded since I'm in a hurry, but it gets the work done
const puppeteer = require('puppeteer');
const width = 1707;
const height = 13062;
//const zoomFactor = 1.5;
const zoomFactor = 1;
const url = "http://localhost:8000/";
@MatteoGheza
MatteoGheza / focal_lenght_dump.sql
Created December 26, 2024 16:56
Extract focal lenght used in a whole Lightroom catalogue
SELECT "focalLength", COUNT(*) AS "count"
FROM "main"."AgHarvestedExifMetadata"
WHERE "focalLength" IS NOT NULL
GROUP BY "focalLength"
ORDER BY "focalLength" ASC;
@MatteoGheza
MatteoGheza / keybase.md
Created October 9, 2023 14:13
Keybase proof

Keybase proof

I hereby claim:

  • I am matteogheza on github.
  • I am matteogheza (https://keybase.io/matteogheza) on keybase.
  • I have a public key ASBOugiVGSeGepcHkc4FckeWDN3jH-_zVIh5SAUNthtpAAo

To claim this, I am signing this object:

@MatteoGheza
MatteoGheza / ricerca-sulla-crittografia.ipynb
Created June 3, 2023 09:12
Ricerca sulla crittografia.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MatteoGheza
MatteoGheza / Extract frames.ps1
Created May 9, 2023 21:24
Extract frames using FFMPEG from a directory of videos, 1FPS, saving them in a TMP directory and purging that after use, between every video.
$Folder = Read-Host "Specify folder with videos"
$TMPFolder = "tmp"
$SkippedFilesNumber = 0
If (Test-Path -Path $TMPFolder -PathType Container) {
Get-ChildItem -Path $TMPFolder -Include *.* -Recurse | foreach { $_.Delete()}
} Else {
New-Item $TMPFolder -ItemType Directory > $null
}
@MatteoGheza
MatteoGheza / Stairville-PAR64-CX-3-RGBW.qxf
Created March 26, 2023 10:04
Stairville-PAR64-CX-3-RGBW.qxf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE FixtureDefinition>
<FixtureDefinition xmlns="http://www.qlcplus.org/FixtureDefinition">
<Creator>
<Name>Q Light Controller Plus</Name>
<Version>4.12.6</Version>
<Author>Lars Kildholt and Matteo Gheza</Author>
</Creator>
<Manufacturer>Stairville</Manufacturer>
<Model>CX-30 RGB WW Bk</Model>
@MatteoGheza
MatteoGheza / .htaccess
Last active February 15, 2023 00:07
Laravel and SPA (Angular for example) .htaccess config for shared hosting, working in subdirectory
# Go to https://gist.github.com/MatteoGheza/17a63a6b27e1b1d37aa62cdba7d7f2b1 for more information
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On