View between_two_regex
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 |
View all_but_first_line.bash
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" | |
} |
View spell_check.pl
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]}; |
View profanity_search.sh
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 |
View find_files_for_git_log.sh
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 \ |
View find_files_for_git_log.sh
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 |
View compare_codebase_to_testbase_in_terms_of_commits_within_an_interval.sh
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 @ \ |
View commits_on_weekdays_tsv.sh
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}' |
View commits_per_month_tsv.sh
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}' |
View git_commits_in_history.sh
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