Skip to content

Instantly share code, notes, and snippets.

View briandfoy's full-sized avatar

brian d foy briandfoy

View GitHub Profile
@briandfoy
briandfoy / bbedit_backups_git.pl
Last active January 21, 2020 05:46
Make a git repo out of the BBEdit Backups file
#!perl
use v5.26;
use strict;
use warnings;
use feature qw(signatures);
no warnings qw(experimental::signatures);
=encoding utf8
=head1 NAME
#!/bin/sh
<< 'DOCS'
This is a small script I use to run speedtest from cron so I
can monitor some network performance. The speedtest command
comes from the speedtest-cli Python project:
https://github.com/sivel/speedtest-cli
This writes to the log file "speedtest.csv" or the file you specify in SPEEDTEST_LOG:
@briandfoy
briandfoy / mojo_outline.txt
Last active May 19, 2020 02:25
Mojolicious Web Applications book outline
I'm not committing to the book just yet, but I'm thinking about what the outline would be.
I'm thinking about running another Kickstarter if I can find a major sponsor like I did
last time. Email me if you might be that person.
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.
@briandfoy
briandfoy / brady_goat.pl
Last active November 18, 2019 18:48
A Mojo program to check how close Tom Brady is to Drew Brees
#!/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 September 23, 2019 22:33
Digest ESPN's Super Bowl MVP data
#!/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 September 23, 2019 17:30
Is the current episode of This American Life new?
#!/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 September 19, 2019 21:19
Using TMPDIR under taint-checking
#!/Users/brian/bin/perl
use v5.10;
BEGIN {
=pod
Windows:
$ENV{TMPDIR}
@briandfoy
briandfoy / tab_urls.scpt
Created September 13, 2019 17:23
List the URLs in safari tabs
#!/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 July 18, 2019 03:49
Zero out iTunes album rating
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 July 17, 2019 23:18
Turn the list of US National Park sites into JSON
#!/Users/brian/bin/perl
use v5.10;
use open qw(:std :utf8);
=head1 NAME
national_parks.pl - scrape the National Park sites
=head1 SYNOPSIS