Skip to content

Instantly share code, notes, and snippets.

brian d foy briandfoy

Block or report user

Report or block briandfoy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@briandfoy
briandfoy / mojo_outline.txt
Last active Dec 5, 2019
Mojolicious Web Applications book outline
View mojo_outline.txt
I'm not committing to the book just yet, but I'm thinking about what the outline would be.
The basic idea is a tutorial book on writing that would start from scratch and build up.
This is specifically not a reference book that covers every aspect of Mojolicious. The
trick is to figure out all the topics that should be in the book and how to introduce them
gradually. Most topics should be relevant to most of the audience, while uncommon tasks
or lightly used features might not show up at all.
The User-Agent stuff is already in Mojolicious Web Clients.
@briandfoy
briandfoy / brady_goat.pl
Last active Nov 18, 2019
A Mojo program to check how close Tom Brady is to Drew Brees
View brady_goat.pl
#!/Users/brian/bin/perl
use v5.10;
use CLDR::Number;
use Mojo::UserAgent;
use Mojo::Util qw(dumper);
my $url = 'http://www.espn.com/nfl/history/leaders/_/stat/passyards';
@briandfoy
briandfoy / superbowl_mvp_summary.pl
Last active Sep 23, 2019
Digest ESPN's Super Bowl MVP data
View superbowl_mvp_summary.pl
#!/Users/brian/bin/perl
use v5.10;
use Mojo::UserAgent;
use Mojo::Util qw(dumper);
my $ua = Mojo::UserAgent->new;
my $url = 'http://www.espn.com/nfl/superbowl/history/mvps';
@briandfoy
briandfoy / this_american_life.pl
Last active Sep 23, 2019
Is the current episode of This American Life new?
View this_american_life.pl
#!/Users/brian/bin/perl
use v5.26;
use Mojo::UserAgent;
use Term::ANSIColor;
my $ua = Mojo::UserAgent->new;
my $url = 'https://www.thisamericanlife.org/archive';
@briandfoy
briandfoy / tmpdir_and_taint.pl
Last active Sep 19, 2019
Using TMPDIR under taint-checking
View tmpdir_and_taint.pl
#!/Users/brian/bin/perl
use v5.10;
BEGIN {
=pod
Windows:
$ENV{TMPDIR}
@briandfoy
briandfoy / tab_urls.scpt
Created Sep 13, 2019
List the URLs in safari tabs
View tab_urls.scpt
#!/usr/bin/osascript
tell application "Safari"
repeat with w from 1 to number of windows
repeat with t from 1 to number of tabs in window w
log URL of tab t of window w as string
end repeat
end repeat
end tell
@briandfoy
briandfoy / no_album_ratings.scpt
Created Jul 18, 2019
Zero out iTunes album rating
View no_album_ratings.scpt
tell application "iTunes"
if selection is not {} then
set mySelection to selection
repeat with aTrack in mySelection
set album rating of aTrack to 0
end repeat
end if
end tell
@briandfoy
briandfoy / national_parks.pl
Last active Jul 17, 2019
Turn the list of US National Park sites into JSON
View national_parks.pl
#!/Users/brian/bin/perl
use v5.10;
use open qw(:std :utf8);
=head1 NAME
national_parks.pl - scrape the National Park sites
=head1 SYNOPSIS
@briandfoy
briandfoy / neighborhood_scam.pl
Last active Jul 17, 2019
Create a file covering all numbers in a US telephone exchange to import into Google Contants
View neighborhood_scam.pl
#!/usr/bin/perl
use v5.10;
=head1 NAME
neighborhood_scam_groups.pl - generate contact groups for all the numbers in a exchange
=head1 SYNOPSIS
$ perl neighborhood_scam_groups.pl AREA_CODE EXCHANGE > scam.csv
@briandfoy
briandfoy / pause_cloudflare.pl
Created Jun 19, 2019
A Mojo script to pause cloudflare sites
View pause_cloudflare.pl
#!/usr/bin/perl
use v5.10;
use strict;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
# Translate the first command-line argument to the Mojo::JSON method to use
my $pause = $ARGV[0] ? 'true' : 'false';
You can’t perform that action at this time.