Skip to content

Instantly share code, notes, and snippets.

@zmousm
zmousm / git_stale_branches.sh
Last active May 11, 2018 09:45
Notify committers about stale branches in a repository. This is mostly useful in environments where collaborators push to a shared repository.
#!/bin/bash
usage () {
cat >&2 <<EOF
Usage: $0 (-r /path/to/git/repo | -u scheme:///git/repo/to/clone) [OPTIONS]
Detect potentially stale branches in a git repository and notify committers
or a designated party.
Mandatory arguments to long options are mandatory for short options too.
@zmousm
zmousm / phabricator.sieve
Created April 25, 2019 07:44
phabricator mail address header normalization: To: -> differential reviewers or maniphest task owner, Cc: subscribers (up to 3)
require [ "regex", "editheader", "relational", "variables" ];
if header :is "X-Phabricator-Sent-This-Message" "Yes" {
# assumption: common mail domain
set "msfx" "@example.com";
# match up to 3 subscribers
if header :regex "X-Phabricator-Stamps" "subscriber\\([@#]([^\\)]+)\\)(.+subscriber\\([@#]([^\\)]+)\\))?(.+subscriber\\([@#]([^\\)]+)\\))?" {
set "psub" "${1}${msfx}";
if string :count "ne" "${3}" ["0"] {
set "psub" "${psub}, ${3}${msfx}";
@zmousm
zmousm / DEI_Shared_Areas_New_Bill_Code.gs
Created October 13, 2025 20:51
Google Apps Script to check for and download new bills for DEI (PPC) Shared Areas (κοινόχρηστα) contracts
/*** CONFIG ***/
const CONFIG = {
accountNumber: '', // <-- your contract account
emailTo: '', // recipient
driveFolderId: '', // optional: Drive folder ID to also save the PDF ('' to skip)
userAgent: 'Mozilla/5.0 (AppsScript)',
baseUrl: 'https://mydei.dei.gr',
loginUrl: 'https://mydei.dei.gr/en/login/',
sharedUrl: 'https://mydei.dei.gr/en/shared/',
// property keys