Skip to content

Instantly share code, notes, and snippets.

View danielebarbaro's full-sized avatar
💭
🚀

Daniele Barbaro danielebarbaro

💭
🚀
View GitHub Profile
@danielebarbaro
danielebarbaro / git-landed
Created October 29, 2026 15:45
git landed: delete local branches already merged, squashed or rebased, with their worktrees
#!/usr/bin/env bash
# git landed: remove local branches (and their worktrees) already landed on the
# default branch, whether merged, squashed or rebased. Lists first, asks before
# deleting. Dirty worktrees and unverified branches are never touched.
#
# Install: save as git-landed somewhere on PATH, chmod +x, run `git landed`.
# Optional: gh (GitHub CLI) to also recognise branches of merged pull requests.
#
# Squash detection adapted from not-an-aardvark/git-delete-squashed (MIT).
#
@danielebarbaro
danielebarbaro / php2shell-update.sh
Last active October 21, 2026 13:55
php2shell-update
#!/usr/bin/env bash
# php2shell-update.sh
# Aggiorna PHP alle versioni che correggono CVE-2026-109618 / CVE-2026-109619
# e riavvia PHP-FPM e i processi gestiti da supervisor (Horizon, Reverb, code, Octane).
# Uso: sudo bash php2shell-update.sh
# Non installa versioni nuove: aggiorna solo i pacchetti PHP gia' presenti.
# Mantiene i php.ini esistenti (--force-confold).
set -uo pipefail
@danielebarbaro
danielebarbaro / credit-card-regex.md
Created August 28, 2020 12:27 — forked from michaelkeevildown/credit-card-regex.md
Credit Card Regex Patterns

Credit Card Regex

  • Amex Card: ^3[47][0-9]{13}$
  • BCGlobal: ^(6541|6556)[0-9]{12}$
  • Carte Blanche Card: ^389[0-9]{11}$
  • Diners Club Card: ^3(?:0[0-5]|[68][0-9])[0-9]{11}$
  • Discover Card: ^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$
  • Insta Payment Card: ^63[7-9][0-9]{13}$
  • JCB Card: ^(?:2131|1800|35\d{3})\d{11}$
  • KoreanLocalCard: ^9[0-9]{15}$