Skip to content

Instantly share code, notes, and snippets.

View mfontani's full-sized avatar

Marco Fontani mfontani

View GitHub Profile
#!/usr/bin/env perl
use 5.020_000;
use warnings;
# Based on Damian Conway's bin/file_template
my %TEMPLATE_FOR = (
'.sh' => \&gen_sh_file,
'.pm' => \&gen_pm_file,
'.pl' => \&gen_pl_file,
#!/bin/sh
# The first comments out the "Conflicts:" part of a merge commit.
# The second creates a template for a commit message
# The third example adds a Signed-off-by line to the message, that can
# still be edited. This is rarely a good idea.
# This hook is invoked by git commit right after preparing the default log
# message, and before the editor is started.
# It takes one to three parameters. The first is the name of the file that
# contains the commit log message. The second is the source of the commit

Keybase proof

I hereby claim:

  • I am mfontani on github.
  • I am mfontani (https://keybase.io/mfontani) on keybase.
  • I have a public key whose fingerprint is 809D 2E19 BAAB 34F0 F06B A9FE 0082 DA0D 3C87 9073

To claim this, I am signing this object:

"" Marco Fontani - MFONTANI@cpan.org
set nocompatible
"" fix title string under iTerm
set t_ts=]1;
" ensure the shell is interactive, so values prepended to $PATH are kept, and
" so that plenv and similar actually work
set shell=$SHELL\ -l
@mfontani
mfontani / -
Created September 22, 2015 12:42
severity = 1
verbose = 8
# Allows us to set use strict;use warnings before package keyword
[-Modules::RequireExplicitPackage]
[Lax::RequireExplicitPackage::ExceptForPragmata]
# make scripts - like t/ - exempt from this policy
exempt_scripts = 1
# this is what we *use* to make this module work...
@mfontani
mfontani / -
Created September 22, 2015 11:45
severity = 1
verbose = 8
# Allows us to set use strict;use warnings before package keyword
[-Modules::RequireExplicitPackage]
[Lax::RequireExplicitPackage::ExceptForPragmata]
# make scripts - like t/ - exempt from this policy
exempt_scripts = 1
# this is what we *use* to make this module work...
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $c = shift;
$c->render( template => 'index' );
};
get '/*' => sub {
my $c = shift;
#!/usr/bin/env perl
use common::sense;
use DateTime;
use Text::Table;
my $now = DateTime->from_epoch(epoch => time, time_zone => 'UTC');
my @where = qw<
UTC
Europe/London
Europe/Rome
@mfontani
mfontani / keybase.md
Created September 23, 2014 23:11
Keybase authorization

Keybase proof

I hereby claim:

  • I am mfontani on github.
  • I am mfontani (https://keybase.io/mfontani) on keybase.
  • I have a public key whose fingerprint is 7D94 1D1C CF93 1598 A567 01B3 D47F C150 38AE 4D5E

To claim this, I am signing this object:

@mfontani
mfontani / sql-beaufity
Created June 14, 2013 15:28
Beautify DBIC_TRACE=1 dumped SQL to a human readable format which doesn't suck
#!/usr/bin/env perl
use strict;
use warnings;
use SQL::Beautify;
use 5.010_001;
# Whether or not to replace "?" in the given SQL with the
# values contained at the end of the SQL, a la:
# SELECT foo FROM bar WHERE baz = ? ORDER BY foo DESC: 'barbaz'
# becomes: