This file contains 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/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; |
This file contains 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/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"; |
This file contains 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
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*}; |
This file contains 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
#!/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" |
This file contains 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
# scripts/capsule.sh | |
if [ -f 'dist.ini' ]; then | |
echo "Found dist.ini, using Dist::Zilla" | |
#dzil authordeps | cpanm | |
#cpanm --installdeps . | |
echo "Installing author deps" >> $logfile | |
dzil authordeps | cpanm >> $logfile 2>&1 | |
echo "Installing dist deps" >> $logfile | |
dzil listdeps | cpanm >> $logfile 2>&1 |
This file contains 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
Dancing on the cloud | |
okram@BLUEDESK ~> sudo aptitude install python-setuptools | |
[...] | |
okram@BLUEDESK ~> sudo easy_install dotcloud | |
[...] | |
okram@BLUEDESK ~> dotcloud | |
Warning: /home/okram/.dotcloud/dotcloud.conf does not exist. |
This file contains 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
" split edit the source file for the Perl module under the current WORD | |
nnoremap ,m :execute 'spl `perldoc -l ' . expand("<cWORD>") . '`'<CR> | |
nnoremap ,M :execute 'vspl `perldoc -l ' . expand("<cWORD>") . '`'<CR> |
This file contains 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
# Based on http://blogs.perl.org/users/randy_stauner/2011/06/exploratory-one-liners-with-less-typing.html | |
# and a couple more things which are *really* handy | |
function raptor { | |
case "$1" in | |
-*) break ;; | |
'') | |
echo "Syntax: raptor [-lneEp etc] 'code' | |
The code can make use of: | |
DD() to Data::Dumper::Dumper() a thing, D() to say() it | |
YY() to YAML::Dump() a thing, Y() to say() it |
This file contains 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/env perl | |
use 5.010_001; | |
use strict; | |
use warnings; | |
use Digest::SHA; | |
use JSON::XS; | |
use WWW::Mechanize; | |
use Time::HiRes qw<time gettimeofday tv_interval>; | |
use Getopt::Long; |
This file contains 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
#!/bin/sh | |
# Usage: | |
# Once you started git rebase --interactive master, and you are presented | |
# with the list of commit SHAs and commit messages, from Vim: | |
# - visually select all SHAs via "V}k" | |
# - launch git-rr: !git-rr | |
# - ... | |
# - profit! you now have the same info as before, just with the list of | |
# filenames which changed with each commit, and can now move around |
OlderNewer