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 / 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';
View Preferences.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 Mar 17, 2019
Download the home game schedules for all the Major League Baseball teams
View mlb_home_games.pl
#!/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 Mar 13, 2019
The sublime-text color scheme that I like
View briandfoy.sublime-color-scheme
/*
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 Jan 27, 2019
Merge multiple files
View merge_files.py
#!/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 Jan 9, 2019
Another FizzBin without an if
View fizzbin-bits.pl
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 Nov 18, 2018
Mirror the stuff in various tumblr pages
View tumblr.pl
#!/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);
You can’t perform that action at this time.