Skip to content

Instantly share code, notes, and snippets.

View briandfoy's full-sized avatar

brian d foy briandfoy

View GitHub Profile
@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 / 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 / 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.
#!/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 / 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
@briandfoy
briandfoy / new_password
Last active May 22, 2020 12:34
(Perl) generate some random passwords
#!/Users/brian/bin/perl -CASD
use v5.30;
use open qw(:std :utf8);
use Math::Random::Secure qw(irand rand);
=encoding utf8
=head1 NAME
@briandfoy
briandfoy / minion_outline.md
Created May 27, 2020 21:20
Ideas for a Minion book

Minion draft outline

  • Introduction

  • Setup

    • SQLite
    • Postgres
    • dashboard
    • enqueue a job, run a task
    • one Minion to bind them all
theme = perl7
[TestingAndDebugging::RequireUseStrict]
add_themes = perl7
[TestingAndDebugging::RequireUseWarnings]
add_themes = perl7
[InputOutput::ProhibitBarewordFileHandles]
add_themes = perl7
@briandfoy
briandfoy / wp2local.pl
Created November 9, 2020 08:05
Turn a WordPress XML dump into a bunch of local files
#!perl
use v5.10;
use experimental qw(signatures);
use File::Path qw(make_path);
use File::Spec::Functions;
use Mojo::DOM;
use Mojo::URL;
use Mojo::Util qw(dumper);
use XML::LibXML;
@briandfoy
briandfoy / gist:30be6d46c005dc27003518ece2f53a74
Created January 15, 2021 09:57
Convert an ePub to Mobi
#!/usr/bin/perl
use v5.26;
use experimental qw(signatures);
=head1 NAME
zamzar_epub_to_mobi - use Zamzar to convert an ePub to Mobi
=head1 SYNOPSIS