Skip to content

Instantly share code, notes, and snippets.

View briandfoy's full-sized avatar

brian d foy briandfoy

View GitHub Profile
@briandfoy
briandfoy / a-The First Day of MTV Videos.md
Last active September 23, 2025 05:19
The first 116 Music Videos on MTV
@briandfoy
briandfoy / github_missing_days.sh
Created September 12, 2025 00:04
Find the days you did not contribute to GitHub
#!/bin/sh
USER=${GITHUB_USER}
FROM=$(date -u +"%Y-01-01T00:00:00Z")
TO=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
gh api graphql -f query='
query($login:String!,$from:DateTime!,$to:DateTime!){
user(login:$login){
contributionsCollection(from:$from,to:$to){
@briandfoy
briandfoy / mojo-server.pl
Created September 1, 2025 19:28
A mojo server inside a program
#!perl
use v5.40;
use Mojolicious::Lite;
use Mojo::Server::Daemon;
use Mojo::UserAgent;
my $port = 3000;
my $pid = fork;
@briandfoy
briandfoy / perl-method-calling-demo.pl
Created July 9, 2025 17:12
A demonstration of some Perl method calling features
#!/usr/bin/perl
{
package Parent;
sub bar { print "Parent: $_[0]" . "\n" }
}
{
package Foo;
use parent qw(Parent);
@briandfoy
briandfoy / net-ssh-perl-rt2github.pl
Created January 14, 2024 19:11
Import rt.cpan.org issues to GitHub issues
use v5.26;
use open qw(:std :utf8);
use Mojo::JSON qw(decode_json);
use Mojo::UserAgent;
use Mojo::Util qw(dumper);
# See another gist to create JSON https://gist.github.com/briandfoy/656a8986e2d998122e37486df1f1f999
@ARGV = '/Users/brian/Desktop/net-ssh-perl-rt.json';
my $raw = Mojo::File->new($ARGV[0])->slurp;
@briandfoy
briandfoy / rt_cpan_org_export
Created July 14, 2023 08:03
rt_cpan_org_export - a program to export an rt.cpan.org queue to JSON
use v5.26;
use warnings;
=encoding utf8
=head1 NAME
rt_cpan_org_export - grab the tickets for an rt.cpan.org queue
=head1 SYNOPSIS
@briandfoy
briandfoy / make_pull_request_feed.pl
Created June 27, 2023 11:40
Make an Atom feed for pull requests to a GitHub repo
#!/Users/brian/bin/perl
use v5.36;
use open qw(:std :utf8);
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
my( $user, $repo ) = split m|/|, $ARGV[0];
my $url = $ARGV[1];
<html>
<head>
<title>Selector example</title>
</head>
<body>
<a href="https://stackoverflow.com/a/76537358/2766176">https://stackoverflow.com/a/76537358/2766176</a>
<div>
@briandfoy
briandfoy / grab-gist
Last active February 12, 2025 22:00
A Mojo::UserAgent program to grab all the files in a gist
#!/usr/bin/perl
=encoding utf8;
=head1 NAME
grab-gist - download all the files in a gist
=head1 SYNOPSIS
#!/Users/brian/bin/perl
use v5.36;
use open qw(:std :utf8);
use utf8;
use File::Basename;
use Text::Shellwords qw(shellwords);
=head1 NAME