Skip to content

Instantly share code, notes, and snippets.

View shoorick's full-sized avatar
🔍
Looking for new job as backend of fullstack web developer

Alexander Sapozhnikov shoorick

🔍
Looking for new job as backend of fullstack web developer
View GitHub Profile
@shoorick
shoorick / accordion-vertical-css3-transition.html
Created January 10, 2012 15:29
CSS3 transition sample - Vertical Accordion
<!DOCTYPE html>
<html>
<head>
<title>CSS3 Transition - Accordion sample</title>
<!-- 2012-01-10 - Alexander Sapozhnikov - http://shoorick.ru/ -->
<style>
body {
font-family: "Liberation Sans",sans-serif;
color: #000;
background-color: #fff;
@shoorick
shoorick / link-extractor.pl
Created October 7, 2011 17:50
Extract http-links from HTML and plain text
@shoorick
shoorick / arbitrary-sort.pl
Created September 19, 2011 21:44
Sort list in desired order
#!/usr/bin/perl -l
# COMPANY: South Ural State University
# CREATED: 09/20/2011 02:09:31 AM
use strict;
use warnings;
=head1 USAGE
./sort.pl
@shoorick
shoorick / scalar-assign.pl
Created September 15, 2011 14:15
Assigning @list in scalar context works as length @list
#!/usr/bin/perl -l
my @array = qw( alice bob charlie daddy elf );
print @array; # alicebobcharliedaddyelf
my $size = @array;
print $size; # 5, same as length @array
@shoorick
shoorick / lingua-translit-russian.pl
Created September 7, 2011 14:36
Compare transliteration tables for Russian
#!/usr/bin/perl
use Lingua::Translit;
my $sample = 'Эй, жлоб! Где туз? Прячь юных съёмщиц в шкаф.';
my $tr;
for ( 'ALA-LC RUS', 'ISO 9', 'DIN 1460 RUS', 'GOST 7.79 RUS', 'GOST 7.79 RUS OLD' ) {
$tr = new Lingua::Translit( $_ );
printf "%17s %s\n", $_, $tr->translit( $sample );
@shoorick
shoorick / tab-separated-fields-as-pod-list.sh
Created August 19, 2011 05:35
Print field list from tab-separated file as POD-formatted list
head -n 1 tab-separated.txt \
| perl -na -F'\t' \
-e 'map { printf "=item %d\n\n%s / %s\n\n", $i++, chr(0x40+$i), $_ } @F '
@shoorick
shoorick / list-png-not-symlink
Created May 3, 2011 10:26
List regular PNG
@shoorick
shoorick / MyApp-Model-DBI.pm
Created December 23, 2010 13:46
DBI model for Catalyst with UTF-8 support
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'},
@shoorick
shoorick / 3_td.pl
Created December 13, 2010 15:44
URL-driven language choosing example with Mojolicious::Lite and Mojolicious::Plugin::Textdomain
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->render(
'template' => 'index',
'count' => int rand 33,
);
@shoorick
shoorick / 2_td.pl
Created December 13, 2010 09:15
Mojolicious::Lite with Mojolicious::Plugin::Textdomain example
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->render(
'template' => 'index',
'count' => int rand 33,
);