Skip to content

Instantly share code, notes, and snippets.

View kentfredric's full-sized avatar
🤔

Kent Fredric kentfredric

🤔
View GitHub Profile
#!/usr/bin/perl
use strict;
use warnings;
use DBIx::Class::EncodedColumn::Digest;
# Paraphrased copy of DBIx::Class::EncodedColumn::Digest::make_check_sub
#
my %digest_lengths = (
'MD2' => { base64 => 22, binary => 16, hex => 32 },
Whirlpool:
left ne right, but no input has been added
left: 19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3
right: 13be938ee61f7e4b006e64648404b2da9a6441e0f4d1569629327424832997ac1db96ff79b18e7db472f6d5da4c6e93e63b5c85808e0a5e8ae2ac5e6f96b02b7
MD5:
left eq right
Whirlpool:
left ne right, but no input has been added
left: 19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3
perl -MDevel::SimpleTrace script/foo_server.pl
syntax error at /home/kent/perl/git/foo-backend/script/../lib/Foo/Controller/Bar.pm line 111, near ")
#Abort on error
return"
BEGIN not safe after errors--compilation aborted
at <eval>(/home/kent/perl/git/foo-backend/script/../lib/Foo/Controller/Bar.pm:128)
at <eval>(/usr/lib64/perl5/vendor_perl/5.10.1/Catalyst/Utils.pm:280)
at Catalyst::Utils::ensure_class_loaded(/usr/lib64/perl5/vendor_perl/5.10.1/Catalyst/Utils.pm:280)
at Catalyst::setup_components(/usr/lib64/perl5/vendor_perl/5.10.1/Catalyst.pm:2174)
@kentfredric
kentfredric / Foo.pm
Created October 19, 2009 12:58
Carp::Always makes backtraces SUCK more for some reason.
package Foo;
use utf8;
use Moose;
extends 'Catalyst';
__PACKAGE__->config( name => 'Foo' );
__PACKAGE__->setup();
package WMDs;
use strict;
use warnings;
# Plagurised from Catalyst::Util;
sub anarchy {
my $error;
{
# Form.tt
<!-- the 'form' wrapper is a hookable printer that by default just stuffs in the form, and where the form is going to -->
[% WRAPPER form %]
<!-- Fields that aren't entirely self-rendering, but parts of the field are -->
<!-- note: the 'field' wrapper can theoretically possibly be a callback that allows either
generic wrapping of form elements, or specific on a name-by-name basis
-->
[% WRAPPER field name=email %]
<span>[% label %]</span><span>[% field %]</span><span>[% description %]</span>
[% END %]
#!/usr/bin/perl
use strict;
use warnings;
use POSIX qw( dup pipe );
use IO::File;
use IO::Handle;
use Data::Dump qw( dump );
#!/usr/bin/perl
use strict;
use warnings;
use Sys::Syslog;
use IPC::Run::Fused qw( run_fused );
use Data::Dumper qw( Dumper );
$Data::Dumper::Indent = 0;
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use namespace::clean;
BEGIN {
my $symtab;
#!/usr/bin/perl
use strict;
use warnings;
use HTTP::Engine;
my $engine = HTTP::Engine->new(
interface => {
module => 'ServerSimple',
args => {