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 / 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 / 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 / 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 / link-extractor.pl
Created October 7, 2011 17:50
Extract http-links from HTML and plain text
@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 / accordion-horizontal-css3-transition.html
Created January 12, 2012 18:52
CSS3 transition sample - Horizontal Accordion
<!DOCTYPE html>
<html>
<head>
<title>CSS3 Transition - Accordion sample</title>
<!-- 2012-01-12 - Alexander Sapozhnikov - http://shoorick.ru/ -->
<style>
body {
font-family: "Liberation Sans",sans-serif;
color: #000;
background-color: #fff;
@shoorick
shoorick / sphinxdrupal-ru.po
Created April 6, 2012 09:59
Russian translation for Sphinxdrupal
# Russian translation for sphinxdrupal https://bitbucket.org/ivinco/drupal-7-sphinx-search-module/
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-04-05 18:45+0600\n"
"PO-Revision-Date: 2012-04-06 13:40+0600\n"
"Last-Translator: Alexander Sapozhnikov <shoorick@cpan.org>\n"
@shoorick
shoorick / word-color.pl
Created April 23, 2012 12:22
Print color stripes with HTML colouring
#!/usr/bin/perl
=head1 USAGE
./word-color.pl
=head1 DESCRIPTION
Print color stripes. See L<http://habrahabr.ru/post/142570/>
@shoorick
shoorick / get-width-stat.sh
Created September 21, 2012 05:20
Get statistics for screen resolution and sum it by width
wget 'https://www.openstat.ru/rest/v0.3/ct:openstat:trends/display/columns/20120820-20120920?column=0%0Dvisitors_sum_average&column=0%0Dvisitors_sum_average_verticalpercent&column=0%0Dsessions_sum&column=0%0Dpageviews_sum&primary_column=0&view_id=1810&format=tsv' -O - \
| perl -nlaF'\t' -MList::Util=max \
-e '$F[0]=~s/x.*//||next;$sum{$F[0]}+=$F[4];END{for$k(0..max(keys%sum)){print"$k\t$sum{$k}"}}'
@shoorick
shoorick / bar-between-natural-and-flats.ly
Created March 4, 2013 17:07
Sample where new key signs (naturals and sharps/flats) divided by bar: ♮ | ♯
\version "2.14.2"
\relative c' {
\key e \major
\cadenzaOn
e4 gis b a
s
\key a \minor
s256
\cadenzaOff
\bar "|"