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 AnyEvent::HTTPD; | |
| my $httpd = AnyEvent::HTTPD->new(port => 3000); | |
| use MogileFS::Client; | |
| my $client = MogileFS::Client->new( domain => "test", hosts => ["localhost:7001"] ); | |
| use MIME::Types; | |
| my $mime = MIME::Types->new; |
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 | |
| # USAGE: | |
| # perl ldapi.pl schema.ldif | |
| # will have the same result as running | |
| # ldapadd -Y EXTERNAL -H ldapi:/// -f schema.ldif | |
| use Modern::Perl; | |
| use Net::LDAP; |
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 Modern::Perl; | |
| use Data::SPath spath => {}; | |
| use Data::Dumper; | |
| { | |
| package Hello; | |
| 1; | |
| } |
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
| # full webdav configuration with | |
| # https://github.com/arut/nginx-dav-ext-module | |
| server { | |
| listen 7500; | |
| access_log /var/log/nginx/localhost.access.log; | |
| error_log /var/log/nginx/localhost.error.log; | |
| location / { |
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 Modern::Perl; | |
| use MooseX::Declare; | |
| class Counter { | |
| has value => ( | |
| is => "rw", | |
| isa => "Num", | |
| traits => ['Counter'], | |
| default => 0, | |
| handles => { |
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 Modern::Perl; | |
| use MooseX::Declare; | |
| class Person { | |
| has name => ( | |
| is => "rw", | |
| isa => "Str", |
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
| (if (and (>= emacs-major-version 23) (eq window-system 'w32)) | |
| (progn | |
| (setq frame-setting | |
| '( | |
| (font . "Consolas-14") | |
| (left . 120) | |
| (width . 80) | |
| (height . 42) | |
| )))) |
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
| require "rubygems" | |
| require "active_record" | |
| require "logger" | |
| config = { | |
| :adapter => "mysql2", | |
| :encoding => "utf8", | |
| :reconnect => false, | |
| :database => "migration", | |
| :pool => 5, |
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 5.010; | |
| use Badger::Timestamp; | |
| my $ts = Badger::Timestamp->new($ARGV[0]); | |
| say $ts->timestamp; | |
| say $ts->epoch_time; |
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/perl6 | |
| my @hello = "hello", "world"; | |
| say @hello.perl; | |
| for @hello -> $item { | |
| say $item | |
| } |