Skip to content

Instantly share code, notes, and snippets.

View pjlsergeant's full-sized avatar
🙇‍♂️
I don't really have time for this anymore

Peter Sergeant pjlsergeant

🙇‍♂️
I don't really have time for this anymore
  • Bangkok, Thailand
View GitHub Profile
@pjlsergeant
pjlsergeant / Wrong.pm
Created November 17, 2016 09:53
First few steps of porting `wrong` to Perl. This is stupid.
# `wrong` in Perl. https://github.com/sconover/wrong
#
#
=head1 SYNOPSIS
#!perl
use strict;
@pjlsergeant
pjlsergeant / solver.pl
Created July 8, 2016 08:47
Simple OO backtracking Sudoku solver
package Sudoku;
1;
package Sudoku::Grid {
use strict;
use warnings;
use Cell;
@pjlsergeant
pjlsergeant / gist:fb33fe3bd15cf02865b582c2b1350670
Last active June 2, 2016 05:24
Perl RE Australian Postcodes
/(?:3(?:7(?:5[0-9]|6[0-7]|2[02-8]|3[0235-9]|1[1-5789]|8[1235-9]|0[0145789]|9[1235679]|4[014679]|7[05789])|5(?:5[0124-9]|8[013-689]|6[1-8]|7[0-3569]|2[0-3579]|0[0125679]|9[014-79]|4[02469]|1[25-8]|3[0137])|3(?:5[0-7]|3[0-578]|1[01245789]|7[01345789]|0[0-59]|2[1-589]|9[0-356]|8[014578]|4[0125]|6[0134])|8(?:5[0-46-9]|0[02-9]|9[0-3568]|1[02-68]|8[025-9]|2[0-5]|7[013458]|4[01247]|6[02459]|3[1235])|0(?:[245][0-9]|6[0-8]|7[0-689]|3[0-46-9]|1[0-35689]|9[013-79]|8[1-5789]|0[0-468])|6(?:3[0-9]|6[0-69]|7[0-35-8]|4[0134679]|9[0145789]|1[0246-9]|2[0-49]|8[235789]|0[78]|5[89])|4(?:6[0-5789]|3[0-578]|4[0124678]|8[0235789]|2[034789]|1[2-589]|0[01279]|9[01468]|5[0138]|7[2578])|2(?:[37][0-9]|2[0-8]|8[0-79]|1[1-9]|0[0124-7]|6[04-9]|4[0-39]|5[014]|9[234])|9(?:2[0-35-9]|1[0-35689]|[35][01346-9]|4[0-6]|6[024-7]|7[15-9]|9[01256]|8[01478]|0[02349])|1(?:[346-9][0-9]|5[0-689]|[02][1-9]|1[13-6]))|2(?:7(?:3[0-9]|9[0-5789]|5[0-46-9]|6[0-35-9]|1[0-7]|0[0-35-8]|7[03-9]|2[0125679]|8[02-7]|4[5789])|3(?:[25][0-9]|4[0-8]|1[0124-9]|0[02-9]|3[03
#!perl
use strict;
use warnings;
use Test::BDD::Cucumber::StepFile;
use Test::Mojo;
# Instantiates a new Test::Mojo object, and save it in the scenario-level stash.
# Rather than do this per-scenario, we'll store a copy in the feature-level and
### Keybase proof
I hereby claim:
* I am pjlsergeant on github.
* I am pjlsergeant (https://keybase.io/pjlsergeant) on keybase.
* I have a public key whose fingerprint is 24D0 CFF6 6CE6 C9EE 9731 962B AA91 4EB0 D57E E0AC
To claim this, I am signing this object:
1993
* 02 Jun '93: Dave Raggett updates his HTML+ DTD to include support for "INPUT and SELECT form interaction elements"[0]
* 05 Sep '93: Marc Andreessen says NCSA Mosaic 2.0 will submit form parameters as: "name=value&name=value&name=value"[1]
* 13 Sep '93: Rob McCool announces NCSA httpd 1.0a1[2], which supports:
"server scripts, which are executable programs which the server runs to generate documents on the fly. They are easy to write and can be written in your favorite language, whether it be C, PERL, or even the Bourne shell" [3]
* 14 Nov '93: Rob McCool complains that his users are avoiding writing code because they think the interface will change, and throws open a bunch of open-issues he wants fixing in what he calls the "gateway"
#!perl
use strict;
use warnings;
my %digits = map { $_ => 1 } ( 0 .. 9 );
sub choose ($&) {
my ( $set, $sub ) = @_;
map { $sub->($_) } grep { $set->{$_} } keys %$set;
@pjlsergeant
pjlsergeant / output.html
Created August 17, 2013 07:54
Pause author ID creation over time
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart","table"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable( {
"cols": [
{"id":"date","label":"Month Beginning","type":"date"},
@pjlsergeant
pjlsergeant / gist:6255791
Created August 17, 2013 07:51
Count new Pause IDs
#!perl
use strict;
use warnings;
use LWP::Simple;
use DateTime;
use Data::Google::Visualization::DataTable;
# Create a datatable
#!/usr/bin/env perl
use 5.012;
use warnings;
use JSON::XS qw(decode_json);
foreach (1..2) {
my $string = '{"a":false,"b":false}';
my $decode = decode_json($string);