Skip to content

Instantly share code, notes, and snippets.

Cameron RogerDodger

  • Australia
Block or report user

Report or block RogerDodger

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
@RogerDodger
RogerDodger / osu_lz.pl
Created Mar 26, 2019
Calculate Lempel-Ziv complexity of beatmap note intervals
View osu_lz.pl
use 5.01;
use warnings;
use strict;
use Data::Dump;
for my $bm (glob "beatmaps/*") {
say "\n### " . substr($bm, 9) . " ###";
my $deltas = beatmap_deltas($bm);
say "Length: " . sum($deltas) / 1000 . "s";
say "Intervals: " . ($#$deltas + 1);
@RogerDodger
RogerDodger / writeoff-scrape.pl
Last active Aug 29, 2015
Grabs stories from writeoff.me and saves them to disk
View writeoff-scrape.pl
#!/usr/bin/env perl
# Scrape writeoff.me events for stories and write them to files
use Mojo::Base -strict;
use Mojo::UserAgent;
use File::Spec;
# IDs of events to scrape
my @events = (1..23);
View hon-thread-user-activity-checker.pl
#!/usr/bin/env perl
use Mojo::Base -strict;
use Mojo::UserAgent;
use DateTime;
use DateTime::Format::Strptime;
my $id = shift or print <<"USAGE" and exit(1);
usage: $0 thread
USAGE
View nurble.pl
use Mojolicious::Lite;
open my $fh, "<", "nouns.txt";
my @nouns = map { chomp && lc $_ } $fh->getlines;
close $fh;
sub nurble {
my $text = uc shift;
$text =~ s{
@RogerDodger
RogerDodger / md2bbc.pl
Last active Oct 21, 2019
Converts Markdown to BBCode
View md2bbc.pl
#!/usr/bin/env perl
use strict;
use warnings;
use 5.01;
use Text::Markdown;
use Encode;
use HTML::Entities;
use Getopt::Long;
@RogerDodger
RogerDodger / JudgeDistr.pl
Created Aug 25, 2012
Distributes stories to judges (using input from UNIX wc)
View JudgeDistr.pl
#!/usr/bin/perl -w
use warnings;
use strict;
use List::Util qw/shuffle min sum/;
use feature qw/say/;
use utf8;
# Usage:
# $wc *.txt | $0 <outfile>
@RogerDodger
RogerDodger / mafia_role_assg.pl
Created Jul 17, 2012
Randomly assigns players into a mafia setup
View mafia_role_assg.pl
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dump;
use feature qw/say/;
use List::Util qw/shuffle/;
my %setups = (
Scumcity => [
@RogerDodger
RogerDodger / storyVoter.pl
Created Jun 20, 2012
Runs through stories in heats to judge which ones are best.
View storyVoter.pl
#!/usr/bin/perl
use warnings;
use strict;
use List::Util qw/shuffle/;
if($#ARGV != 2 || grep {$ARGV[0] eq $_} qw/help h/) {
print
"Usage: perl $0 <inputfile> <outputfile> <groupsize>\n",
" <inputfile> is the name of the file containing the stories to be\n",
You can’t perform that action at this time.