This file contains 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
/* compile like this: gcc -o test test.c -ldl */ | |
#include <stdio.h> | |
#include <dlfcn.h> | |
int main(void) | |
{ | |
const char *path = "/usr/lib64/lua/5.1/lgob/webkit.so"; | |
void *handle; |
This file contains 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 $error; | |
local $SIG{__DIE__} = sub { | |
( $error ) = @_; | |
$cond->send; | |
}; | |
$cond->recv; | |
if($error) { | |
( $status, $headers, $body ) = ( 500, ['Content-Type' => 'text/plain'], [ $error ] ); | |
} |
This file contains 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
package MyPackage; | |
has path => ( | |
is => 'ro', | |
isa => 'Str', | |
default => sub { | |
return '~/Sandbox'; | |
}, | |
traits => ['ExpandHome'], | |
); |
This file contains 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 Moose; | |
use MooseX::Types -declare => [qw/Arrayify/]; | |
use MooseX::Types::Moose qw/Any ArrayRef Str/; | |
subtype Arrayify, | |
as ArrayRef; | |
coerce Arrayify, |
This file contains 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 plackup | |
use strict; | |
use warnings; | |
use autodie qw(exec fork open); | |
use IO::Pipe; | |
sub { |
This file contains 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
perl -le 'my $str = q{TEST}; $pat = "test"; my $mod = "i"; $regex = qr/(?^$mod:$pat)/; print $str =~ $regex;' |
This file contains 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 $body = IO::File->new('some-large-file', 'r'); | |
my $sender = sub { | |
my ( $h, $continuation ) = @_; | |
my $body_h; | |
$body_h = AnyEvent::Handle->new( | |
fh => $body, | |
on_read => sub { | |
my $buf = $body_h->rbuf; |
This file contains 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
[general] | |
conferences = yapcna | |
cookie_name = act | |
searchlimit = 20 | |
dir_photos = photos | |
dir_ttc = var/ | |
max_imgsize = 320x200 | |
root = $(home)/wwwdocs | |
default_language = en | |
languages = en |
This file contains 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; | |
builder { | |
enable $mw1; | |
enable $mw2; | |
enable $mw3; | |
$app; | |
}; # this works like normal! |
This file contains 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
function env_require(module, env) | |
local loaders = package.loaders | |
local errors = {} | |
local load_fn | |
for _, loader in ipairs(loaders) do | |
local fn = loader(module) | |
if type(fn) == 'function' then | |
load_fn = fn | |
break | |
elseif type(fn) == 'string' then |