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
diff --git a/lib/Starman/Server.pm b/lib/Starman/Server.pm | |
index c98af6f..a927e0d 100644 | |
--- a/lib/Starman/Server.pm | |
+++ b/lib/Starman/Server.pm | |
@@ -21,6 +21,29 @@ my $null_io = do { open my $io, "<", \""; $io }; | |
use Net::Server::SIG qw(register_sig); | |
+sub SSL_key_file { | |
+ my ($self, $host, $port, $proto) = @_; |
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
---------------------------------------------------------- | |
== Twiggy == | |
app.psgi: | |
my $app = sub { | |
return [ 200, ['Content-Type' => 'text/plain'], [ "Hello world\n"] ]; | |
}; | |
[sugar@host dir]$ twiggy --listen 127.0.0.1:8080 app.psgi |
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 $root = '.'; | |
my @indexes = qw(index.html); | |
use strict; | |
use warnings; | |
use Plack::App::File; | |
use Plack::App::Cascade; | |
sub directory_indexes { | |
my ($root, @indexes) = @_; | |
my $file = Plack::App::File->new(root => $root)->to_app; |
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 strict; | |
use warnings; | |
use File::Basename; | |
use Plack::Builder; | |
use Plack::App::CGIBin; | |
my $basedir = dirname(__FILE__); |
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
<div id="post-assets"></div> | |
<div class="module-header" id="loading-more-assets"><img src="http://static.typepad.com/.shared:v20110208.01-0-gebb190b:typepad:en_us/images/spinner.gif"/></div> | |
<style> | |
.entry-content { | |
border-bottom: solid 1px #CCC; | |
padding-bottom: 10px; | |
margin-bottom: 10px; | |
padding-top: 10px; | |
} |
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 strict; | |
use warnings; | |
use Pod::Usage; | |
use Text::Markdown 'markdown'; | |
use HTML::TreeBuilder; | |
use List::Util 'max'; |
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
require 'rubygems' | |
require 'mongo' | |
module MongoPubSub | |
QUEUES_COLLECTION = 'queues' | |
class EndSubscriptionException < Exception; end | |
class Publisher | |
def initialize(queue_name, mongo_connection) | |
# Initialize queue collection as a capped collection | |
if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name) |
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 strict; | |
use warnings; | |
my $input = shift or die "Usage: $0 Masayoshi"; | |
my %phoetic_alphabet; | |
while(<DATA>) { | |
chomp; | |
my ($letter, $word) = split(/\s+/, $_, 2); |
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 Data::Dumper; | |
my @r; | |
my $text = q{@hoge http://example.com/#@hoge/ aaa #hash aaa @hogehoge aaa http://example.com/}; | |
my $re = qr{(http://[A-Za-z0-9_\-\~\.\%\?\#\@/]+(?{push @r, ["HTTP", @-,@+] })|(?:^|\s)\@[A-Za-z0-9_]+(?{push @r,["AT", @-,@+]})|(?:^|\s)#[A-Za-z0-9_]+(?{push @r,["HashTag",@-,@+]}))}; | |
warn $text; | |
() = $text =~/$re/g; | |
warn Dumper @r; |
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
=head1 NAME | |
Plack::Loader - (auto)load PSGI/Plack Servers | |
=head1 SYNOPSIS | |
#!/usr/bin/env perl | |
# printenv-like app in PSGI, F?CGI, AnyEvent, Coro, POE or Danga::Socket | |
use strict; | |
use warnings; |