Skip to content

Instantly share code, notes, and snippets.

Alexander Sapozhnikov shoorick

View GitHub Profile
@shoorick
shoorick / Makefile
Created Dec 19, 2018
Makefile for trimming PNG files and making them 2-bit black and white
View Makefile
SRC=.
DST=2b
FILES=*.png
trim $(DST)/$(FILES): $(SRC)/$(FILES)
for file in $(SRC)/$(FILES); do \
[ ! -f $(DST)/$$file -o $(SRC)/$$file -nt $(DST)/$$file ] \
&& echo $$file \
&& convert $(SRC)/$$file -dither none -colors 2 -trim +repage $(DST)/$$file; \
done
@shoorick
shoorick / p2yaml.pl
Last active Nov 29, 2018
Reserialize PHP-serialized data to YAML
View p2yaml.pl
#!/usr/bin/perl -0777 -n
=head1 NAME
p2yaml.pl - PHP to YAML reserializer.
=head1 DESCRIPTION
Reserialize PHP-serialized data to YAML
View 2.html.ep
%= include 'header';
<%= $callee %> <%= $name %>!
Some text here
View 1.html.ep
%#= include 'header'; # Does not work
%# layout 'layout'; # Does not work
<%= $callee %> <%= $name %>!
Some text here.
View hash-value-overwrite-due-to-similar-keys.pl
#!/usr/bin/perl
# https://stackoverflow.com/questions/48529062/hash-value-overwrite-due-to-similar-keys
use Data::Dumper;
my $mapping_table = {
'Exemplare' => 'copies',
'Seiten' => 'pages',
'Statushinweis' => 'status',
@shoorick
shoorick / simple.pl
Created Sep 18, 2018 — forked from knutov/gist:78b7043ee6ea4f345f6da55670e65582
mojolicious async external command execution using Mojo::IOLoop
View simple.pl
#!/usr/bin/perl
# $Id: receiver_manage.pl 1977 2010-10-14 09:12:15Z bfg $
# $Date: 2010-10-14 11:12:15 +0200 (Thu, 14 Oct 2010) $
# $Author: bfg $
# $Revision: 1977 $
# $LastChangedRevision: 1977 $
# $LastChangedBy: bfg $
# $LastChangedDate: 2010-10-14 11:12:15 +0200 (Thu, 14 Oct 2010) $
# $URL: https://svn.interseek.com/repositories/admin/misc/cic/receiver_manage.pl $
@shoorick
shoorick / bike-area.dot
Last active Jul 4, 2017
Where I was with bicycle.
View bike-area.dot
graph G {
node [ shape=box, fontsize=10, fontname="Droid Sans", style=filled, height=0.2 ]
edge [ color=gray50, penwidth=3, fontname="Droid Sans" ]
graph [ overlap=false ]
subgraph main {
node [ fillcolor=pink ]
"Б. Акуля" [ shape=folder ]
"Еланчик" [ shape=folder ]
@shoorick
shoorick / mark-academic-buildings.pl
Last active Sep 11, 2016
Mark in PostGIS buildings which belongs to South Ural State University
View mark-academic-buildings.pl
#!/usr/bin/perl -w
use strict;
=head1 DESCRIPTION
Marks academic buildings which belongs to SUSU relation in PostGIS:
set type='academic'. This mark-up used for map coloring.
=head1 SEE ALSO
@shoorick
shoorick / extract-mapbox-tiles.pl
Last active Sep 11, 2016
Extract tiles from *.mbtiles file made by TileMill
View extract-mapbox-tiles.pl
#!/usr/bin/perl
# VERSION: 1.0
# CREATED: 10.02.2013 23:41:17
use strict;
use warnings;
=head1 USAGE
View panoramio-rss.pl
#!/usr/bin/env perl
=head1 USAGE
./panoramio-rss.pl
=head1 DESCRIPTION
Get RSS feed of my photos from panoramio.com and make HTML list of images
You can’t perform that action at this time.