Skip to content

Instantly share code, notes, and snippets.

@dotandimet
dotandimet / gist:857366
Created March 6, 2011 15:51
test for Mojo::Loader arbitrary code execution
#!/usr/bin/env perl
use warnings;
use strict;
# Mojo::Loader executes arbitray code - via vti
# perl -MMojo::Loader -e 'Mojo::Loader->load(qq{Mojo::Loader;print "nice feature!"})'
# http://twitter.com/#!/vtivti/status/44408695613952000
use Test::More tests => 2;
@dotandimet
dotandimet / gist:832561
Created February 17, 2011 20:09
mojo response streaming with redirection
#!/usr/bin/env perl
use warnings;
use strict;
use Test::More;
use Test::Mojo;
use Mojolicious::Lite;
post '/foo' => sub {
my $self = shift;
@dotandimet
dotandimet / gist:643649
Created October 24, 2010 16:21
why does decode hang in perl -d ?
#!/usr/bin/env perl
use strict;
use warnings;
use Mojo::JSON;
my $str = qq{[
{
"text" : "
use ojo;
my $s = oO( q{http://}
. join(q{:}, @ARGV)
. q{@api.twitter.com/1/statuses/friends_timeline.json}
)->json;
foreach (@$s) {
print Oo($_->{user}{screen_name}, q{: }, $_->{text});
my @links =
map { $_ =~ s/\.$//; $_ }