This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Carp; | |
use v5.10; | |
use constant FALSE => 1==0; | |
use constant TRUE => not FALSE; | |
# Given two regex that match a start and end line, return blocks of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Silently shift the first line off input sent through a pipe. | |
all_but_first_line(){ | |
# Read from a pipe | |
declare input=${1:-$(</dev/stdin)}; | |
# Print all but the first line of input | |
tail -n +2 <<< "$input" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl -w | |
# Suggest alternate spellings for a word | |
use strict; | |
use Text::Aspell; | |
my $speller = Text::Aspell->new; | |
my $word = qq{$ARGV[0]}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
profane_regex=$( | |
perl -e ' | |
use Bad::Words; | |
my $wordref = new Bad::Words; | |
my $updated = $wordref->remove(qw( | |
xxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filesystem_paths=$( | |
find . \ | |
-name "*.php" \ | |
-not -name "*Test.php" | |
) | |
git log \ | |
--since='3 weeks ago' \ | |
--format='%ad' \ | |
--date=iso-local \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filesystem_paths=$(find . -name "*Test.php") | |
git log \ | |
--since='3 weeks ago' \ | |
--format='%ad' \ | |
--date=iso-local \ | |
$filesystem_paths \ | |
| cut -d ' ' -f1 \ | |
| sort \ | |
| uniq -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
echo 'app/' | |
echo 'test/' | |
) \ | |
| xargs -I@ bash -c " | |
echo @ | |
git log \ | |
--since='3 weeks ago' \ | |
--format='%ad' \ | |
--date=iso-local @ \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TZ=$(date +%z) git log --reverse --date-order --format="%cd" --date=iso-local \ | |
| dateround -S Sun \ | |
| cut -d'T' -f1 \ | |
| uniq -c \ | |
| column -t \ | |
| perl -pwe 's{\s+}{\t}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TZ=$(date +%z) git log --reverse --date-order --format="%cd" --date=iso-local \ | |
| cut -d- -f1-2 \ | |
| uniq -c \ | |
| column -t \ | |
| perl -pwe 's{\s+}{\t}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repo_age=$(git log --date=relative --reverse --format="%ad" | head -n1) | |
commits_in_history=$(git log --pretty=oneline | wc -l) | |
echo "$commits_in_history commits since $repo_age" |
NewerOlder