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
| $ git clone -b dev git@github.com:reisegiganten/libraries.git --depth=1 libraries-dev | |
| Cloning into 'libraries-dev'... | |
| warning: templates not found /home/nicolasm/.gittemplate | |
| remote: Counting objects: 525, done. | |
| remote: Compressing objects: 100% (485/485), done. | |
| remote: Total 525 (delta 52), reused 196 (delta 17), pack-reused 0 | |
| Receiving objects: 100% (525/525), 10.66 MiB | 1.97 MiB/s, done. | |
| Resolving deltas: 100% (52/52), done. | |
| Checking connectivity... done. | |
| ✔ 19:21 /projects/Reisegiganten $ cd libraries-dev/ |
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
| package RG::BackendConfig; | |
| use strict; | |
| use warnings; | |
| use Moo; | |
| extends 'RG::Config'; | |
| has '+name' => ( is => 'ro', default => 'reisegigantenadmin'); |
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
| ---------- Forwarded message ---------- | |
| From: Andreas Marienborg <andreas.marienborg@startsiden.no> | |
| Date: 2015-06-02 16:42 GMT+07:00 | |
| Subject: Re: Forespørsel om å utgi utvalgte biblioteker som åpen kildekode | |
| To: Nicolas Mendoza <nicolas.mendoza@startsiden.no> | |
| Cc: tlg@startsiden.no | |
| Hey, |
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/lib/Reisegiganten.pm b/lib/Reisegiganten.pm | |
| index 31fd492..5614df3 100644 | |
| --- a/lib/Reisegiganten.pm | |
| +++ b/lib/Reisegiganten.pm | |
| @@ -188,7 +188,7 @@ sub setup_attrs { | |
| my ($self) = @_; | |
| $self->attr( 'db_config' => sub { RG::Config->new; }); | |
| - $self->attr( 'cache' => sub { CHI->new( driver => 'FastMmap', cache_size => '10m', root_dir => '/tmp/mmap_' . __PACKAGE__, expire_time => '10m', expires_in => '10 min', expires_variance => 0.1 )}); | |
| + $self->attr( 'cache' => sub { CHI->new( $ENV{NO_CACHE} ? ( Driver => 'Null' ) : $self->config->{cache} ) }); |
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
| package MyApp::Base; | |
| use Moose; | |
| has 'abc' => ( is => 'ro', lazy => 1, default => 'def', reader => 'get_abc' ); | |
| has 'xyz' => ( is => 'ro', lazy => 1, default => 123, reader => 'get_xyz' ); | |
| around [qw/get_abc get_xyz/] => sub { | |
| my ($orig, $self) = shift; | |
| return "base: " . $self->$orig; |
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
| autocmd BufWritePre *.{pm,t,pl} call StripTrailingWhite() | |
| function! StripTrailingWhite() | |
| let l:winview = winsaveview() | |
| silent! %s/\s\+$// | |
| call winrestview(l:winview) | |
| endfunction |
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/perl | |
| use v5.10; | |
| =o_O= | |
| .__. | |
| =cut | |
| say "funpod"; |
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
| $ perl -wlE 'say $]; &CORE::warn(1)' | |
| 5.022002 | |
| 1 at -e line 1. | |
| $ perl -wlE 'say $]; &CORE::warn(1)' | |
| 5.014002 | |
| Undefined subroutine &CORE::warn called at -e line 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
| nicolasm@tipsy:/tmp $ cat Foo.pm | |
| package Foo; | |
| use Moo; | |
| has 'path' => ( is => 'lazy', default => sub { return __FILE__ } ); | |
| 1; | |
| nicolasm@tipsy:/tmp $ cat SubFoo.pm | |
| package SubFoo; | |
| use Moo; | |
| extends 'Foo'; |
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/perl | |
| use Data::Dumper; | |
| local $Data::Dumper::Indent = 0; | |
| package A; | |
| use Moo; | |
| has a => (is => "ro"); | |
| has b => (is => "ro", lazy => 1, default => sub { shift->a + 1 }); |