Skip to content

Instantly share code, notes, and snippets.

View mfontani's full-sized avatar

Marco Fontani mfontani

View GitHub Profile
@mfontani
mfontani / repack-git-repos.sh
Created November 8, 2010 19:34
Repack all my Git repos, si vous plait!
#!/bin/sh
# Marco Fontani - MFONTANI at cpan dot org
# Repack all the .git repos from the current directory
# using 8 processes at once
find . -type d -name '.git' | \
xargs -I{} -P8 \
sh -c "(cd {}/..; git gc; echo done {})2>/dev/null"
@mfontani
mfontani / 4005150.pl
Created October 23, 2010 17:56
Answer on SO
use strict;
use warnings;
# Column details and sample line, from the post
my $header = q{0 AOZSVIN, TAMSSZ B A A- B+ B B- C+ C C- D+ D D- F CR P PR I I* W WP WF AU NR FN FS};
my $sample = q{0 AAS 150 23 25 16 35 45 14 8 10 2 1 1 4 4 };
# -+--------+-----+-----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---..
# chars 1212345678912345612345612341234123412341234123412341234123412341234123412341234123412341234123412341234123412341234...
# num. chars: 2 9 6 6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 *
my $unpack = q{A2A9 A6 A6 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A4 A*};
#!/usr/bin/env perl
use strict;
use warnings;
# List of previously installed modules was created with:
# perldoc -o text perllocal | grep '"Module"' | cut -d'"' -f3 | cut -d' ' -f2
my $installed = shift;
$installed = "$ENV{HOME}/perl-installed-20100908-1917.txt" unless defined $installed;
print "Using modules list from $installed\n";
#!/usr/bin/env perl
use Mojolicious::Lite;
my $use_auth = 1; # with auth enabled..
my ( $user, $pass ) = qw/user password/;
if ($use_auth) { plugin 'basic_auth'; }
get '/' => sub { my $self = shift; $self->redirect_to('/upload'); };
get '/upload' => sub {
my $self = shift;