shlomif-email-signature / gen-shlomif-at-iglu-sig


use strict;
use warnings;

use IO::All;

use File::Spec::Functions qw( catpath splitpath rel2abs );

my $script_dir = catpath( ( splitpath( rel2abs $0 ) )[ 0, 1 ] );

my $sig = io()->file($ENV{HOME}."/.signature")->slurp();

# my ($quote) = ($sig =~ m{(([^\n]*\w[^\n]*\n)+)\z}ms);

my @resource_lines =
    qq{Apple Inc. is Evil -},
    qq{Best Introductory Programming Language -},
    qq{Escape from GNU Autohell -},
    qq{First stop for Perl beginners -},
    qq{Free (Creative Commons) Music Downloads, Reviews and more -},
    qq{Freecell Solver -},
    qq{Chuck Norris/etc. Facts -},
    qq{Funny Anti-Terrorism Story -}, # The Enemy and How I Helped to Fight it.
    qq{"Humanity" - Parody of Modern Life -},
    qq{Interview with Ben Collins-Sussman -},
    qq{List of Portability Libraries -},
    qq{List of Text Editors and IDEs -},
    qq{List of Text Processing Tools -},
    qq{List of Networking Clients -},
    qq{My Aphorisms -},
    qq{My Public Domain Photos -},
    qq{My Favourite FOSS -},
    qq{Original Riddles -},
    qq{Optimising Code for Speed -},
    qq{Parody of "The Fountainhead" -},
    qq{Perl Humour -},
    qq{Rethinking CPAN -},
    qq{Stop Using MSIE -},
    qq{Selina Mandrake - The Slayer (Buffy parody) -},
    qq{"Star Trek: We, the Living Dead" -},
    qq{The Case for File Swapping -},
    qq{"The Human Hacking Field Guide" -},
    qq{Understand what Open Source is -},
    qq{UNIX Fortune Cookies -},
    qq{Beginners Site for the Vim text editor -},
    qq{What does "Zionism" mean? -},
    qq{What Makes Software Apps High Quality -},
    qq{Why I Love Perl -},

my $line = $resource_lines[rand(@resource_lines)];

my $quotes_text = io()->encoding('utf-8')->file("$script_dir/shlomif-sig-quotes")->slurp;

my @quotes = grep { /\S/ } split(/^\n*%\n*$/ms, $quotes_text);

my $quote = $quotes[rand(scalar(@quotes))];

$quote =~ s{\n+\z}{}ms;
$quote =~ s{\A\n+}{}ms;

my $text = <<"EOF";
Shlomi Fish


Please reply to list if it's a mailing list post - .

binmode STDOUT, ":utf8";
print $text;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.