This file contains hidden or 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 strict; | |
| use warnings; | |
| use HTML::Parser; | |
| my $len = 0; | |
| my $max = 85; | |
| my @close = (); |
This file contains hidden or 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 $orig = \&Noembed::Util::http_get; | |
| local *Noembed::Util::http_get = sub { | |
| my $cb = pop; | |
| my $url = shift; | |
| my $hash = sha1_hex $url; | |
| $orig->($url, @_, sub { | |
| my ($body, $headers) = @_; | |
| open my $fh, ">", "t/data/requests/$hash"; |
This file contains hidden or 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
| import shield; | |
| vcl_recv { | |
| if (shield) { | |
| shield.conn_reset(); | |
| } | |
| else { | |
| error 403 "Forbidden"; | |
| } | |
| } |
This file contains hidden or 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
| var noembed = { | |
| patterns : [], | |
| callbacks : {}, | |
| callback_counter: 0, | |
| setup : function(selector) { | |
| if (!selector) selector = "a[href]"; | |
| var elems = document.querySelectorAll(selector); | |
| if (elems.length) { | |
| noembed.get_patterns(function() { |
This file contains hidden or 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
| def test_weird_formats | |
| tif = Asset::Image.new(@odd_formats[:tif][:input], "rmagick") | |
| assert_equal "jpg", tif.format | |
| assert_equal "rmagick.jpg", tif.filename | |
| bmp = Asset::Image.new(@odd_formats[:bmp][:input], "rmagick"); | |
| assert_equal "png", bmp.format | |
| assert_equal "rmagick.png", bmp.filename | |
| end |
This file contains hidden or 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
| aseed:alice leedo$ perl -Ilib ./bin/multialice.pl | |
| spawning some alice instances | |
| 2011-12-28 11:11:53.779200 -0500 info Alice::Standalone: Location: http://127.0.0.1:9000/ | |
| 2011-12-28 11:11:53.789192 -0500 info Alice::Standalone: Location: http://127.0.0.1:9001/ | |
| 2011-12-28 11:11:53.813952 -0500 info Alice::Standalone: Location: http://127.0.0.1:9003/ |
This file contains hidden or 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
| use v5.14; | |
| use overload; | |
| sub BEGIN { | |
| overload::constant integer => sub {(shift) * rand}; | |
| } | |
| say 4; |
This file contains hidden or 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
| diff --git a/lib/AnyEvent/IRC/Client.pm b/lib/AnyEvent/IRC/Client.pm | |
| index 4992398..2b2cd98 100644 | |
| --- a/lib/AnyEvent/IRC/Client.pm | |
| +++ b/lib/AnyEvent/IRC/Client.pm | |
| @@ -452,7 +452,9 @@ All keys, except C<nick> are optional. | |
| sub connect { | |
| my ($self, $host, $port, $info) = @_; | |
| - if (defined $info) { | |
| + my $timeout = delete $info->{timeout}; |
This file contains hidden or 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
| [\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\ | |
| xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xf | |
| f\n\015()]*)*\)[\040\t]*)*(?:(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\x | |
| ff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015 | |
| "]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\ | |
| xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80 | |
| -\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]* | |
| )*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\ | |
| \\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\ | |
| x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x8 |
This file contains hidden or 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/perl | |
| use File::Next; | |
| use File::Copy; | |
| use File::Path qw/mkpath/; | |
| my ($source, $dest) = @ARGV; | |
| die "need source and dest" unless -e $source and -e $dest; | |
| my $iter = File::Next::files({ file_filter => sub {/\.(?:png|jpe?g|gif)/i} }, $source); |