Skip to content

Instantly share code, notes, and snippets.

diff --git a/lib/Starman/InputStream.pm b/lib/Starman/InputStream.pm
new file mode 100644
index 0000000..e0cfc38
--- /dev/null
+++ b/lib/Starman/InputStream.pm
@@ -0,0 +1,121 @@
+use strict;
+use warnings;
+
+# -----------------------------------
=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;
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;
#!/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);
#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
use Text::Markdown 'markdown';
use HTML::TreeBuilder;
use List::Util 'max';
@sekimura
sekimura / infinite-scroll-typepad-entries.html
Created February 9, 2011 21:32
infinite scroll typepad blog entries
<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;
}
@audreyt
audreyt / gist:834671
Created February 19, 2011 00:31 — forked from fujiwara/gist:732822
mt.psgi (for both Melody and MT5)
#!/usr/bin/env perl
use strict;
use warnings;
use File::Basename;
use Plack::Builder;
use Plack::App::CGIBin;
my $basedir = dirname(__FILE__);
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;
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) = @_;
@gfx
gfx / foo.pl
Created December 13, 2011 00:57
s///ee
->> perlbrew exec perl -e 'package Foo; s//"warn __PACKAGE__"/ee'
perl-5.10.1
==========
Foo at (eval 1) line 1.
perl-5.12.1
==========
Foo at (eval 1) line 1.