Skip to content

Instantly share code, notes, and snippets.

View mishin's full-sized avatar
💭
if you fail to prepare you prepare to fail

Nikolay Mishin mishin

💭
if you fail to prepare you prepare to fail
View GitHub Profile
@mishin
mishin / _desc.pl
Last active August 29, 2015 14:10 — forked from anonymous/_desc.pl
our %desc = (
"PPIx::Regexp::Node" =>
[
"xRe::Node",
"a container",
#~ "PPIx::Regexp::Dumper->new( 'qr{(foo)}' )->print",
],
"PPIx::Regexp::Node::Range" =>
[
[root@localhost ~]# tailf /opt/IBM/WebSphere/AppServer/profiles/default/logs/server1/SystemOut.log
[22.05.14 11:49:37:546 MSD] 00000025 SystemOut O 2014-05-22 11:49:37 DEBUG - com.estylesoft.xslt.XsltFilter : make transformation for ..-.. /payment/kbk_paychecksums_init.do
[22.05.14 11:49:38:721 MSD] 00000028 SystemOut O setBankAccountId = 2868101357441
[22.05.14 11:49:38:722 MSD] 00000028 SystemOut O 2014-05-22 11:49:38 DEBUG - com.estylesoft.strah.ejb.payment.PaymentHandlerBean : getKbkPayCheckSums
[22.05.14 11:49:38:762 MSD] 00000028 SystemOut O 2014-05-22 11:49:38 DEBUG - com.estylesoft.xslt.XsltFilter : make transformation for ..-.. /payment/kbk_paychecksums_init.do
[22.05.14 11:49:39:746 MSD] 0000002e SystemOut O setBankAccountId = 2868122243829
[22.05.14 11:49:39:747 MSD] 0000002e SystemOut O 2014-05-22 11:49:39 DEBUG - com.estylesoft.strah.ejb.payment.PaymentHandlerBean : getKbkPayCheckSums
[22.05.14 11:49:39:806 MSD] 0000002e SystemOut O 2014-05-22 11:49:39 DEBUG - com.esty
# install perlbrew
curl -O -L http://xrl.us/perlbrew
perl perlbrew install
rm perlbrew
# setup perlbrew
~/perl5/perlbrew/bin/perlbrew init
echo "source $HOME/perl5/perlbrew/etc/bashrc" >> ~/.bashrc
# restart your shell
@mishin
mishin / .bashrc.sh
Last active August 29, 2015 14:15 — forked from yannk/.bashrc.sh
# add in your .bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# http://blog.cyberion.net/2009/01/improved-bash-prompt-for-git-usage.html
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master⚡]$ # dirty working directory
#
# I've made the following ajustements:
# - Use of plumbing, that should be faster than git status porcelain.
# - Don't show my repo as dirty if it has files unknown from the index (I always have).
#!/usr/local/bin/perl
#
# This find dists where the distname in the metadata doesn't match the name of the
# dist as embedded in the release file name.
#
use strict;
use warnings;
use MetaCPAN::Client;
use CPAN::DistnameInfo;
#! /bin/sh
pod2man --utf8 $1 | iconv -t iso8859-5 | nroff -Tlatin1 -c -man - | iconv -f iso8859-5 | less
#!/usr/local/bin/perl
#
# cpan-repository-hosts
#
# Generate list of the different hosts that appear in the CPAN repository field
# Get a list of all the repository strings from MetaCPAN, then chop them around
# to get the host part
#
use strict;
use warnings;
git log --shortstat | awk '/Author|changed/' | perl -lne'if ( /^Author: (.+)/ ) { $author = $1 } else { while ( /(?:(\d+) (?:insertions|deletions))/g ) { $changes{ $author } += $1 } } END { print "$changes{$_} $_" for keys %changes }'
# 2674 Doug Bell <[email protected]>
# 18332 Doug Bell <[email protected]>
@mishin
mishin / 1.pl
Last active August 29, 2015 14:18 — forked from Dalboz/1.pl
#From http://www.xav.com/perl/faq/Windows/ActivePerl-Winfaq12.html
#How do I extract a series of cells from Microsoft Excel?
#If you have a sheet object you can extract the values of a series of cells through $Sheet->Range-> #{'Value'}, for example:
my $array = $Sheet->Range("A8:B9")->{'Value'};
#Now $array[0][0] contains the value of cell A8, $array[0][1] the value of cell B8, $array[1][0] the value #of cell A9 and $array[1][1] the value of cell B9.
@mishin
mishin / dumper.pl
Last active August 29, 2015 14:19 — forked from knutov/dumper.pl
#!/usr/bin/env perl
use v5.14;
# cpanm utf8::all Data::Dumper::Perltidy Data::Dumper
use utf8::all;
#===========
# TODO: move to standalone module
use Data::Dumper::Perltidy;