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 / css_parser.pl
Last active August 29, 2015 14:06 — forked from wki/css_parser.pl
use strict;
use warnings;
use feature ':5.10';
use Marpa::XS;
use Data::Dumper;
#
# a simple CSS snippet for testing
#
my $text = q{
@mishin
mishin / css_parser.pl
Last active August 29, 2015 14:06 — forked from wki/css_parser.pl
use strict;
use warnings;
use feature ':5.10';
use Marpa::XS;
use Data::Dumper;
#
# a simple CSS snippet for testing
#
my $text = q{
@mishin
mishin / gtrans.pl
Last active August 29, 2015 14:06 — forked from jl2/gtrans.pl
#!/usr/bin/perl
# By: Jeremiah LaRocco
# Use translate.google.com to translate between languages.
# Sample run:
# gtrans.pl --to french --from english This is a test
# Ceci est un test
#
use strict;
@mishin
mishin / gtrans2.pl
Last active August 29, 2015 14:06 — forked from ruz/gtrans2.pl
#!/usr/bin/env perl
# By: Jeremiah LaRocco, Nikolay Mishin (refactoring)
# Use translate.google.com to translate between languages.
# Sample run:
#gtrans.pl --from en --to ru --text "This is a test"
use Modern::Perl;
use LWP::UserAgent;
use Getopt::Long;
#!/usr/bin/env perl
use strict;
use warnings;
use Carp;
use Getopt::Long;
use Pod::Usage;
use File::Basename qw/fileparse/;
use File::Spec;
use Spreadsheet::ParseExcel;
@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;