Skip to content

Instantly share code, notes, and snippets.

Alexander Sapozhnikov shoorick

View GitHub Profile
@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 / 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,
);
@shoorick
shoorick / MyApp-Model-DBI.pm
Created Dec 23, 2010
DBI model for Catalyst with UTF-8 support
View MyApp-Model-DBI.pm
package MyApp::Model::DBI;
use strict;
use warnings;
use base 'Catalyst::Model::DBI';
# skipped some configuration statements
__PACKAGE__->config(
'dsn' => 'dbi:mysql:' . $config->{'sql'}->{'database'} . ':' . $config->{'sql'}->{'host'},
View list-png-not-symlink
You can’t perform that action at this time.