Skip to content

Instantly share code, notes, and snippets.

Alexander Sapozhnikov shoorick

View GitHub Profile
View wcloop
#!/usr/bin/perl
print STDERR "Press ^C to exit\n";
my $cmd_line = 'wc ' . join ' ', @ARGV;
my $out;
while (1) {
$out = `$cmd_line`;
chomp $out;
print "\cM$out";
sleep 1;
@shoorick
shoorick / compress_kate's_html.pl
Created May 11, 2010
Compressor for HTML generated by kate
View compress_kate's_html.pl
#!/usr/bin/perl -pw
use strict;
s{#([[:xdigit:]])\1([[:xdigit:]])\2([[:xdigit:]])\3}{#$1$2$3}g;
s{<(b|i|em|strong)></\1>}{}gi;
s{</(b|i|em|strong)><\1>}{}gi;
@shoorick
shoorick / gpsout.pl
Created May 11, 2010
Print out GPS coordinates from images
View gpsout.pl
#!/usr/bin/perl -wl
use strict;
=head1 DESCRIPTION
Print out GPS coordinates from images
=head1 AUTHOR
Alexander Sapozhnikov
View diff-colorizer
#!/usr/bin/perl -n
use Term::ANSIColor;
print colored( $_, 'red' ) and next if /^</;
print colored( $_, 'green' ) and next if /^>/;
print colored( $_, 'bold blue' ) and next if /^[\d,]+[acd][\d,]+$/;
print;
=head1 NAME
@shoorick
shoorick / move-images.pl
Last active Sep 5, 2015
Moves images from memory card into specified directory and rename these images
View move-images.pl
#!/usr/bin/perl -wl
=head1 NAME
move-images - move images and group them together.
=head1 DESCRIPTION
Move images from memory card to HDD:
remove leading letters from its names, lowercase these names,
@shoorick
shoorick / .XCompose
Last active Sep 21, 2015 — forked from astanin/.XCompose
My Compose key configuration
View .XCompose
include "/usr/share/X11/locale/en_US.UTF-8/Compose"
# See
# http://s.arboreus.com/2008/02/compose.html
# http://shoorick.livejournal.com/tag/compose
# Punctuation
# знаки препинания, необходимые в русском, которых нет в en_US.UTF-8/Compose
<Multi_key> <period> <minus> : "…" U2026 # HORIZONTAL ELLIPSIS, многоточие
<Multi_key> <period> <space> : "…" U2026 # HORIZONTAL ELLIPSIS, многоточие
@shoorick
shoorick / resize-mark.pl
Created Sep 28, 2010
Image resizer and marker
View resize-mark.pl
#!/usr/bin/perl -w
use strict;
=head1 DESCRIPTION
Make small pictures from big ones.
=head1 USAGE
resize-mark.pl
@shoorick
shoorick / README
Created Dec 11, 2010
Gettext example with Locale::TextDomain
View README
Example if gettext usage via Locale::TextDomain
How to use:
0. cd po && make
1. ../example/1.pl
or
env LANGUAGE=ru ../example/1.pl
or
@shoorick
shoorick / 2_td.pl
Created Dec 13, 2010
Mojolicious::Lite with Mojolicious::Plugin::Textdomain example
View 2_td.pl
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->render(
'template' => 'index',
'count' => int rand 33,
);
@shoorick
shoorick / 3_td.pl
Created Dec 13, 2010
URL-driven language choosing example with Mojolicious::Lite and Mojolicious::Plugin::Textdomain
View 3_td.pl
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->render(
'template' => 'index',
'count' => int rand 33,
);
You can’t perform that action at this time.