This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm writing tests, and I'm coding tests as non-test code before I put them into | |
my test file. | |
This code uses Perl objects (non-Moose; haven't made it to there yet) to handle | |
DBI connections, so I can do things like put my example code in GitHub gists | |
without being worried that server addresses, logins and passwords were accidentally | |
left in the code. | |
Right now, I'm trying to write tests for this module, and my biggest problem atm is | |
finding a way to test transactions against an existing MySQL database so I'm not |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I plan to redo this as YAML but have yet to | |
# identity , server , port , username , password , directory | |
gmail , imap.gmail.com , 993 , your_username , password , INBOX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use feature qw'say state' ; | |
use subs qw'uniq' ; | |
use Data::Dumper ; | |
use JSON ; | |
use LWP::UserAgent ; | |
use Test::Most ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $data ; | |
my $c = 0 ; | |
for ( 1 .. 3_000 ) { | |
my $row ; | |
for ( 1 .. 10) { | |
push @$row , $c ; | |
$c = ( $c + 1 ) % 8 ; | |
} | |
push @$data , $row ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Multi ; | |
use Class::Multimethods ; | |
use Exporter qw(import) ; | |
our @EXPORT = qw{ | |
test | |
} ; | |
multimethod test => () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use feature qw{ say state } ; | |
use strict ; | |
use warnings ; | |
use Data::Dumper ; | |
my @alphabet = 'a' .. 'z' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use feature qw{ say } ; | |
use Term::ReadKey ; | |
my ( $wchar, $hchar ) = GetTerminalSize() ; | |
for ( 2 .. $hchar ) { | |
say join '' , map { ( 'a' .. 'z' )[ int rand 26 ] } 1 .. $wchar ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1="${debian_chroot:+($debian_chroot)}\u@\h:\$(~/bin/get_temp.pl):\w\n\$ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use feature qw'say' ; | |
use strict ; | |
use warnings ; | |
use DateTime ; | |
use Data::Dumper ; | |
use lib '/home/jacoby/lib' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use feature qw'say' ; | |
use strict ; | |
use warnings ; | |
use Data::Translate ; | |
my $data = new Data::Translate; | |
# allows a2b.pl foobarblee or echo foobarblee | a2b.pl |