Skip to content

Instantly share code, notes, and snippets.

View briandfoy's full-sized avatar

brian d foy briandfoy

View GitHub Profile
@briandfoy
briandfoy / neighborhood_scam.pl
Last active July 17, 2019 23:19
Create a file covering all numbers in a US telephone exchange to import into Google Contants
#!/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 June 19, 2019 04:28
A Mojo script to pause cloudflare sites
#!/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';
@briandfoy
briandfoy / Preferences.sublime-settings
Created April 30, 2019 18:12
My sublime settings
{
"color_scheme": "Packages/User/brian.sublime-color-scheme",
"ensure_newline_at_eof_on_save": true,
"font_face": "Inconsolata Medium",
"font_size": 10,
"highlight_modified_tabs": true,
"hot_exit": false,
"copy_with_empty_selection": false,
"ignored_packages":
[
@briandfoy
briandfoy / mlb_home_games.pl
Last active May 4, 2021 02:47
Download the home game schedules for all the Major League Baseball teams
#!/Users/brian/bin/perls/perl5.28.0
use v5.28;
use utf8;
use strict;
use warnings;
use File::Path qw(make_path);
use File::Spec::Functions;
use IO::Interactive qw(interactive);
use Mojo::Useragent;
@briandfoy
briandfoy / briandfoy.sublime-color-scheme
Last active April 22, 2022 10:51
The sublime-text color scheme that I like
/*
Put this in ~/.config/sublime-text-3/Packages/User
*/
{
"name": "briandfoy",
"author": "brian d foy <brian.d.foy@gmail.com>",
"variables":
{
"black": "hsl(0,0%,0%)",
@briandfoy
briandfoy / merge_files.py
Last active January 27, 2019 03:19
Merge multiple files
#!/usr/local/bin/python3
import heapq
import os
import sys
class MergeFiles:
"""
Given a list of files, output their numbers in sorted order.
@briandfoy
briandfoy / fizzbin-bits.pl
Last active January 9, 2019 21:12
Another FizzBin without an if
use v5.24;
my $n = $ARGV[0] // 35;
my $count = 0;
while($count <= $n) {
state $a = [ \$count, \'Fizz', \'Bin', \'FizzBin' ];
say $a->[ (810092048>>((2*(++$count-1))%30)) & 0b11 ]->$*;
}
@briandfoy
briandfoy / tumblr.pl
Created November 18, 2018 02:39
Mirror the stuff in various tumblr pages
#!/Users/brian/bin/perls/perl-latest
use v5.28;
use utf8;
use open qw(:std :utf8);
use strict;
use warnings;
use feature qw(signatures);
no warnings qw(experimental::signatures);
use IO::Interactive qw(interactive);
@briandfoy
briandfoy / usps_track.pl
Created November 18, 2018 02:32
Get the tracking info for a single USPS shipment
#!/Users/brian/bin/perls/perl-latest
use v5.26;
use utf8;
use strict;
use warnings;
use lib qw(/Users/brian/Dev/business-us-usps-webtools/lib);
use Business::US::USPS::WebTools::TrackConfirm;
use Term::ANSIColor;
@briandfoy
briandfoy / scotus_nominations.csv
Last active October 7, 2018 20:38
Supreme Court nomination history
Nominee President To Replace Nominated to Chief Nomination Date Voice Roll Call No. Yay Nay Difference Action Action Date Delay
Brett Kavanaugh Trump Kennedy Jul 10, 2018 223 50 48 2 Confirmed Oct 6, 2018 88
Neil M. Gorsuch Trump Scalia Feb 1, 2017 111 54 45 9 Confirmed Apr 7, 2017 65
Merrick B. Garland Obama Scalia Mar 16, 2016 No action
Elena Kagan Obama Stevens May 10, 2010 229 63 37 26 Confirmed Aug 5, 2010 87
Sonia Sotomayor Obama Souter Jun 1, 2009 262 68 31 37 Confirmed Aug 6, 2009 66
Samuel A. Alito, Jr. Bush O'Connor Nov 10, 2005 2 58 42 16 Confirmed Jan 31, 2006 82
Harriet Miers Bush O'Connor Oct 7, 2005 Withdrawn Oct 28, 2005 21
John G. Roberts, Jr. Bush Rehnquist x Sep 6, 2005 245 78 22 56 Confirmed Sep 29, 2005 23
John G. Roberts, Jr. Bush O'Connor Jul 29, 2005 Withdrawn Sep 6, 2005 39