Skip to content

Instantly share code, notes, and snippets.

View dspinellis's full-sized avatar

Diomidis Spinellis dspinellis

View GitHub Profile
@dspinellis
dspinellis / wrong-greek-n-endings.sh
Created May 16, 2021 20:19
Show lines (and color) endings that violate the Greek final-n omission rule
#!/bin/sh
#
# Show lines (and color) endings that violate the Greek final-n omission rule
# Exit with a 0 success error code if such lines were found
#
egrep -i --color '\<(αυτήν|την|δεν|μην) ([^κπτξψαεηιουωάέήίόύώϊϋΐΰμνγ]|μ[^π]|ν[^τ]|γ[^κ])'
@dspinellis
dspinellis / pending-reviews.sh
Last active September 21, 2021 09:41
List the caller's pending GitHub pull request reviews
#!/bin/sh
#
# List the caller's pending GitHub pull request reviews
#
user=$(git config github.user)
gh pr list --json number,title,reviewRequests -q '.[] | select(.reviewRequests | any(.login == "'$user'")) | ["#" + (.number|tostring), .title] | @tsv'
@dspinellis
dspinellis / Makefile
Last active March 5, 2022 14:16
Add a help target for any Makefile
URL=https://www.spinellis.gr/unix
love: # Help: Create a file name love
touch love
money: # Help: Hit the jackpot
yes $$ | fmt | head
me a wizard: MOOC # Help: Become a Unix command-line wizard
@dspinellis
dspinellis / cytrox-check.sh
Last active May 29, 2022 14:39
Display host names of Cytrox spyware-hosting sites visited with Firefox
#!/usr/bin/env bash
#
# Display host names of Cytrox spyware-hosting sites visited with Firefox
# See: https://github.com/AmnestyTech/investigations/tree/master/2021-12-16_cytrox
#
# Diomidis Spinellis, May 2022
#
if [ -z "$1" ] ; then
echo "Usage: $0 /path/to/Firefox/places.sqlite" 1>&2
@dspinellis
dspinellis / make-prettierignore.sh
Created July 13, 2022 15:30
Which (auto-generated and third-party) files should @prettiercode ignore?
comm -13 <(git ls-files | sort) <(yarn prettier --check . 2>&1 | sed -n 's/\[warn\] //p' | sort) >.prettierignore
@dspinellis
dspinellis / cp1250-to-cp1253.bas
Last active August 7, 2023 02:27
Old Microsoft Word Greek document fixer
'
' Old Microsoft Word Greek document fixer
'
' Copyright 2023 Diomidis Spinellis
'
' Licensed under the Apache License, Version 2.0 (the "License");
' you may not use this file except in compliance with the License.
' You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0