Create registry entry to associate file extension with application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Time::HiRes qw/time/; | |
use List::Util qw/reduce/; | |
### | |
# finding the max value and its key | |
# in an associative array | |
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ServCGI; | |
######################## | |
# NO security! # | |
# No sense! # | |
# quick and dirty # | |
######################## | |
use HTTP::Server::Simple::CGI; | |
use base qw(HTTP::Server::Simple::CGI); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use 5.010_001; | |
say 'err' if !eval { | |
my $x = 3 / 0; | |
}; | |
# !DANGEROUS! eval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test::More tests => 1; | |
use strict; | |
use warnings; | |
use Data::Types qw/:float/; | |
# module loaded | |
use_ok('Airport::Data'); | |
# fixture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use v5.10.1; | |
use strict; | |
use warnings; | |
use Text::CSV; | |
#use open qw(:std :utf8); | |
my $col_look_up = 'id'; #where to look | |
my @filter_out = ( #what to search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use 5.010.1; | |
my $msg; | |
my $break = qr/^AMQ\d+/; | |
while (<DATA>) { | |
chomp; | |
if ($break .. $break) { | |
if (/($break)/) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v5.10; | |
use strict; | |
use warnings; | |
use open qw(:std :utf8); | |
# HTML source code | |
# grep 'fsl fwb fcb' -i facebook > facebook2 | |
@ARGV = 'facebook2'; | |
# | |
my @arr; | |
while (<>) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
# Ctrl^Z to stop | |
for (<DATA>) {next unless /^http/i; open PAGE, "|less";print PAGE `w3m $_ -dump -cols 50`;} | |
__DATA__ | |
# timeline | |
http://www.slate.com/articles/technology/cover_story/2017/03/twitter_s_timeline_algorithm_and_its_effect_on_us_explained.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# EXAMPLE URL list to scrap | |
# echo 'http://search.mlp.cz/cz/titul/faunovo-odpoledne-a-jine-basne/56699/|http://search.mlp.cz/cz/titul/podivuhodne-pribehy-z-dob-nedavno-minulych/2750824/|http://search.mlp.cz/cz/titul/zpevy-pastyrske/2430570/|http://search.mlp.cz/cz/titul/kam-odchazis-kraso/2192687/|http://search.mlp.cz/cz/titul/plac-housli/2330679/|http://search.mlp.cz/cz/titul/rethinking-the-university/57801/|http://search.mlp.cz/cz/titul/zapisky-stareho-prasaka/2488292/' > seznam | |
# BEWARE! | |
# quick and dirty | |
# HTTP and I/O wasted | |
# actual web-scrapping | |
cat seznam | perl -nE '`wget -qO- $_ 2>/dev/null` =~ m!class="ignac"[^<]+<strong>([^<]+)!sm && say "$1<br>" for split /\|/' > autori.html |