Skip to content

Instantly share code, notes, and snippets.

View briandfoy's full-sized avatar

brian d foy briandfoy

View GitHub Profile
@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 <[email protected]>",
"variables":
{
"black": "hsl(0,0%,0%)",
@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 / 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 / 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 / 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
@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 / 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 / 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 / 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';