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

Licence (MIT Licence)

Copyright (c) 2011 Simon Walker

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

# Written by Olivier Mengué
use utf8;
use strict;
use warnings;
use AnyEvent;
use AnyEvent::HTTP;
my @urls = qw(
# Alternate implementation of https://metacpan.org/module/STEVAN/Promises-0.03/lib/Promises/Cookbook/TIMTOWTDI.pod
# that can run the requests in parallel
# See also a more concrete application of this: https://gist.github.com/dolmen/6306377
my $all_product_info = {};
my $cv = AnyEvent->condvar;
$cv->begin;
http_get('http://rest.api.example.com/-/product/12345', sub {
@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