Skip to content

Instantly share code, notes, and snippets.

View dolmen's full-sized avatar
😁
Happy!

Olivier Mengué dolmen

😁
Happy!
View GitHub Profile
@diegok
diegok / repl.rc
Created October 25, 2011 14:22
My Devel::REPL config file (~/.re.pl/repl.rc)
$_REPL->load_plugin($_) for qw(
History Colors
FancyPrompt Refresh
Interrupt OutputCache
DDC Nopaste
CompletionDriver::Keywords
CompletionDriver::LexEnv
CompletionDriver::Methods
CompletionDriver::INC
@eiro
eiro / gist:1322199
Created October 28, 2011 12:54
inotify based autoreload for perl dancer
#! /usr/bin/env zsh
dancer_pid=
dancer () {
perl bin/dancer &
dancer_pid=$!
}
kill_dancer () { kill $dancer_pid }
restart_dancer () { kill_dancer && dancer }
changes_in_source_tree () {inotifywait -r -e modify --exclude ".*swp" . }
@Zenithar
Zenithar / rio.coffee
Created January 11, 2012 22:50
French RIO Checksum and Check procedure
#
# Used to calculate the checksum
# http://fr.wikipedia.org/wiki/Relev%C3%A9_d'identit%C3%A9_op%C3%A9rateur
#
exports.calcChksm = (oo, q, rrrrrr, notel) ->
concatenation = "#{oo}#{q}#{rrrrrr}#{notel}"
ordre = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+"
a = b = c = 0
for i in concatenation
@dolmen
dolmen / perlmods.sh
Created June 7, 2012 18:11
List installed Perl modules
perl -MExtUtils::Installed "-Esay for ExtUtils::Installed->modules" > perl-modules.$(date +%Y-%m-%d).txt
@dolmen
dolmen / build-perl-profile.pl
Created July 27, 2012 12:39
My perl environment builder: creates ~/.perl/profile to be called in ~/.bash_profile
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Getopt::Long;
my $CPAN_MIRROR = 'http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/cpan/';
GetOptions("mirror=s" => \$CPAN_MIRROR);
@dpetrov
dpetrov / cpan_favorites.pl
Created November 7, 2012 08:24
Install all favorited distributions
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use Mojo::UserAgent;
my $url = shift @ARGV or die "Usage: $0 metacpan_author_url";
my $ua = Mojo::UserAgent->new;
my $dom = $ua->get($url)->res->dom;
@briandfoy
briandfoy / perl-cert.json
Last active December 11, 2015 01:48
A JSON representation of the CERT Perl Secure Coding Standards (https://www.securecoding.cert.org/confluence/display/perl/CERT+Perl+Secure+Coding+Standard)
[
{
"priority" : "P4",
"name" : "Canonicalize path names before validating them",
"rule" : "",
"section" : "1",
"recommedation" : "1",
"level" : "L3",
"url" : "https://www.securecoding.cert.org/confluence/display/perl/IDS00-PL.+Canonicalize+path+names+before+validating+them",
"class" : "IDS00-PL",
@dolmen
dolmen / rt-cli-useful.md
Created January 18, 2013 16:06
rt-cli useful requests
use strict;
use constant_tiny;
use constant pi => 4 * atan2(1, 1);
use constant ponies => qw<
Twilight_Sparkle Fluttershy Pinkie_Pie AppleJack Rainbow_Dash Rarity
>;
use constant {
@dolmen
dolmen / dzil profiling.md
Last active December 11, 2015 11:48
Dist::Zilla profiling
# Get the module list
PROFILING=-d:TraceUse
# Profile with Devel::NYTProf
PROFILING=-d:NYTProf

Quick dzil launch hack:

perl $PROFILING -Ilib -MDist::Zilla -e '$Dist::Zilla::VERSION=$Dist::Zilla::Plugin::GatherDir::VERSION=4.300030; require "bin/dzil"' nop