Skip to content

Instantly share code, notes, and snippets.

View memowe's full-sized avatar
🦉

Mirko Westermeier memowe

🦉
View GitHub Profile
[-3.51683, -3.5158, -3.51477, -3.51375, -3.51272, -3.5117, -3.51068, -3.50966, -3.50864, -3.50762, -3.50661, -3.50559, -3.50458, -3.50357, -3.50256, -3.50155, -3.50054, -3.49954, -3.49853, -3.49753, -3.49653, -3.49553, -3.49453, -3.49354, -3.49254, -3.49155, -3.49055, -3.48956, -3.48857, -3.48759, -3.4866, 3.49225, -0.328805, -1.34216, 3.49247, 4.43746, 5.40083, 9.36892, 8.88003, 4.7641, 4.59343, 5.87603, 4.42209, 0.687832, -0.464351, 2.17726, 9.73545, 5.00514, -0.0212088, 3.77815, 3.95643, 5.31587, 4.54975, -1.17936, -2.08044, 5.08728, 7.62381, 1.39791, 4.19023, 1.15945, 1.08743, 5.93113, -0.694341, 3.5015, 2.66986, 5.60135, 4.72748, -0.84758, 2.72853, -1.38952, 0.809805, 2.90378, 2.33462, 1.44216, 3.10572, 9.70306, 2.26839, 2.91891, 4.71864, 0.924998, 5.77694, 8.34631, 5.45903, 5.55276, 6.14311, 3.90381, 2.05794, -1.35122, 5.27787, 3.30401, -3.63361, -2.27455, 5.74325, 3.87359, 3.66721, 2.75332, 2.18775, 1.70242, -0.839534, 6.49942, 7.55335, 11.3247, 12.0105, 7.89448, 10.2989, 5.60163, 7.35842, 3.05693, -0.
@memowe
memowe / paramdump.pl
Created April 19, 2012 22:25
dumping params
#!/usr/bin/env perl
use Mojolicious::Lite;
use Test::More tests => 4;
use Test::Mojo;
get '/paramdump';
my $t = Test::Mojo->new;
$t->get_ok('/paramdump?foo=bar')->status_is(200)->text_is(title => 'paramdump')
@memowe
memowe / gist:2394091
Created April 15, 2012 17:44
Mojolicious
19:41:47 <@sri> \o/
19:41:51 <@tempire> \o\
19:42:02 <@sri> /o/
19:42:42 <@memowe> \o /
19:42:45 <@memowe> what!?
19:42:58 < inokenty> /o\
19:43:00 * sri repairs memowe
19:43:11 <@memowe> \oF
19:43:16 <@memowe> Thanks!
19:43:21 <@sri> \o/
@memowe
memowe / inflate.pl
Created March 27, 2012 18:02
Mojolicious::Command::inflate dies
#!/usr/bin/env perl
use Mojolicious::Lite;
app->start;
# dies without __END__ or __DATA__:
# Can't use an undefined value as a HASH reference at
# /usr/local/lib/perl5/site_perl/5.12.1/Mojolicious/Command/inflate.pm line 17.
#!/usr/bin/env perl
use Mojo::Home -strict;
use Test::More tests => 42;
use Test::Mojo;
use Mojolicious::Lite;
get '/*foo' => sub {
my $self = shift;
my $foo = $self->param('foo');
#!/usr/bin/env perl
use Mojolicious::Lite;
use Test::More tests => 6;
use Test::Mojo;
get '/' => sub {
my $self = shift;
$self->redirect_to('named', foo => 'bar');
};
#main #subnavi li { font-size: 1em }
#main #subsubnavi li { font-size: .9em }
#main #subsubsubnavi li { font-size: .8em }
#main #subsubsubsubnavi li { font-size: .7em }
#main #subsubsubsubsubnavi li { font-size: .7em }
#main #subsubsubsubsubsubnavi li { font-size: .7em }
#main #subsubsubsubsubsubsubnavi { /* wtf */ }
use Mojo::Base -strict;
use Test::More tests => 8;
use Test::Mojo;
use Mojolicious::Lite;
use FindBin;
get '/first' => {template => '23'};
get '/second' => {template => '42'};
#!/usr/bin/env perl
use Test::More tests => 9;
use Test::Mojo;
use Mojolicious::Lite;
get '/:code' => [code => qr/\d\d\d/] => sub {
my $self = shift;
my $code = $self->param('code');
@memowe
memowe / benchmark.pl
Created January 27, 2012 23:15
short-circuit is 2-16% slower. why?
#!/usr/bin/env perl
use strict;
use warnings;
use Benchmark 'cmpthese';
my $foo = my $bar = 0;
cmpthese(5_000_000, {
'short-circuit' => sub { $foo++; $foo % 2 and 42 + 17 },