Skip to content

Instantly share code, notes, and snippets.

View yanick's full-sized avatar
🏠
Working from home

Yanick Champoux yanick

🏠
Working from home
View GitHub Profile
#!/usr/bin/perl
use Cache::Memcached;
use YAML;
use YAML::Dumper;
print YAML::Dumper->new->dump(
Cache::Memcached->new( servers => [ "localhost:11211" ] )
->get( shift )
);
@yanick
yanick / cpantest2rt.pl
Created October 31, 2010 21:46
Create an RT bug out of a CPAN Testers report
#!/usr/bin/env perl
use strict;
use warnings;
use URI;
use URI::QueryParam;
use LWP::Simple qw/ get /;
use File::Temp qw/ tempfile /;
use Email::Sender::Simple qw(sendmail);
@yanick
yanick / gist:4041382
Created November 8, 2012 20:30
hash_map
#!/usr/bin/perl
use 5.10.0;
use strict;
use warnings;
sub hash_map(&+) {
my( $sub, $hash ) = @_;
my @mapped;
@yanick
yanick / gist:4119156
Created November 20, 2012 16:45
XML::Simple::SelfContained
package XML::Writer::SelfContained;
=pod
Tired of giving a output to XML::Writer? Me too. This allows to do
use 5.10.0;
use XML::Writer::SelfContained;
@yanick
yanick / dancer.snippets
Created December 13, 2012 02:14
UltiSnips file for Dancer
extends perl
## ROUTE DEFINITIONS
snippet get "GET route" !b
get '/${1}' => sub {
${2:${VISUAL:...;}}
};
endsnippet
@yanick
yanick / it_works
Created February 1, 2013 04:04
Whu-- it works?
$ perl bin/rt-to-github.pl puppies App-Cmd
github issues:
ticket 81512
ticket 57808
ticket 59656
ticket 73901
And then https://github.com/yanick/puppies/issues
@yanick
yanick / gist:5278968
Created March 31, 2013 00:32
How to have $c->rs('MyTable') instead of $c->model('DBIx::MyTable')
# in your main application class (e.g. lib/S****T***.pm):
sub rs {
my ( $c, $table ) = @_;
my $model = 'DBIx::' . $table;
return $c->model($model);
}
@yanick
yanick / LockedLockFile.pm
Created April 30, 2013 19:13
Lock the lockfiles
package LockedLockFile;
use strict;
use warnings;
use Moose;
use Path::Tiny;
use File::Flock::Tiny;
@yanick
yanick / autodie_koan.txt
Created October 8, 2013 14:47
An 'autodie' koan
"How can I seek Death?" asked the disciple to the master.
The master smiled. "How can you make mountains rise? How
do you make the sea ebbs at tides? How do you make time flow?"
The disciple frowned. And frowned some more. And then,
in a moment of enlightenment, thought of 'autodie', had
an aneurysm, and died.
@yanick
yanick / gist:9146512
Created February 22, 2014 00:18
Yanick's CPAN releases
$ cpan-release-counts --user YANICK
2005 ( 3) #
2006 ( 17) ######
2007 ( 22) ########
2008 ( 28) ###########
2009 ( 15) ######
2010 ( 45) ##################
2011 ( 57) ######################
2012 ( 76) ##############################
2013 (125) ##################################################