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 Test::More; | |
my @patterns = qw{a b c}; | |
my $string = q{c}; | |
my $pattern = qr{((?{ join "|", @patterns }))}; | |
ok $string =~ $pattern, "matches"; | |
done_testing(); |
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
--- PerlMagick-6.77/Makefile.PL 2012-05-24 18:00:30.000000000 -0500 | |
+++ PerlMagick-6.77-working/Makefile.PL 2013-01-27 15:42:48.000000000 -0600 | |
@@ -154,13 +154,12 @@ | |
} | |
} | |
} | |
- | |
# defaults for LIBS & INC & CCFLAGS params that we later pass to Writemakefile | |
-my $INC_magick = '-I../ -I.. -pthread -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -pthread -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/graphviz -I/usr/include/freetype2 -I/usr/include/libxml2 -I"' . $Config{'usrinc'} . '/ImageMagick"'; | |
-my $LIBS_magick = '-L../magick/.libs -lMagickCore -lperl -lm'; |
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
sub plugins { | |
my ($self, $network, $chan) = @_; | |
return @{$self->{plugins}} unless $network; | |
grep { | |
my $i = $_->config("ircs"); | |
!$i || any { | |
lc $_->[0] eq lc $network | |
&& (!$chan || (!$_->[1] || lc $_->[1] eq lc $chan)) | |
} map {[split "@", $_]} @$i; | |
} @{$self->{plugins}}; |
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 AnyEvent; | |
sub app { | |
my $hook = shift; | |
my $cv = AE::cv; | |
# how to catch any unhandled errors in hook? | |
$hook->(sub { $cv->send(@_) }); | |
$cv->recv; |
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/README.md b/README.md | |
index 55fe848..17c0953 100644 | |
--- a/README.md | |
+++ b/README.md | |
@@ -41,6 +41,14 @@ Hector supports a limited subset of IRC commands. | |
Install Hector with RubyGems and create your server: | |
+ $ git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
+ $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile |
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
open my $wp_config, '<', '../wp-config.php'; | |
my $define_re = qr{define\( \s* ["'] ([^"']+) ["'] \s* , \s* ["'] ([^"']+) ["'] \s* \)}x; | |
my %config; | |
while (my $line = <$wp_config>) { | |
if (my ($constant, $value) = $line =~ $define_re) { | |
$config{$constant} = $value; | |
} | |
} |
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 v5.12; | |
use AnyEvent::HTTP; | |
use HTML::Parser; | |
sub parse_mirrors { | |
my $body = shift; | |
my ($in_us, $in_head, $in_th); | |
my ($mirror, @mirrors); |
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 v5.12; | |
use strict; | |
use warnings; | |
use AnyEvent::HTTP; | |
use HTML::Parser; | |
sub parse_mirrors { |
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 Plack::Builder; | |
use Plack::App::Proxy; | |
builder { | |
enable sub { | |
my $app = shift; | |
sub { | |
my $env = shift; | |
delete $env->{HTTP_ACCEPT_ENCODING}; | |
my $res = $app->($env); |
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
[leedo@trillian ~]$ plackup -MCarp::Always test.pl | |
HTTP::Server::PSGI: Accepting connections at http://0:5000/ | |
EV: error in callback (ignoring): Not a CODE reference at /Users/leedo/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.2/darwin-2level/EV.pm line 1192. | |
EV::__ANON__() called at /Users/leedo/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.2/darwin-2level/AnyEvent/Impl/EV.pm line 88 | |
eval {...} called at /Users/leedo/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.2/darwin-2level/AnyEvent/Impl/EV.pm line 88 | |
AnyEvent::CondVar::Base::_wait('AnyEvent::CondVar=HASH(0x7ffa5bb895c0)') called at /Users/leedo/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.2/darwin-2level/AnyEvent.pm line 1981 | |
AnyEvent::CondVar::Base::recv('AnyEvent::CondVar=HASH(0x7ffa5bb895c0)') called at /Users/leedo/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.2/Plack/App/Proxy/Backend/AnyEvent/HTTP.pm line 60 | |
Plack::App::Proxy::Backend::AnyEvent::HTTP::__ANON__('HASH(0x7ffa5baf3738)') called at /Users/leedo/per |