Skip to content

Instantly share code, notes, and snippets.

View paveljurca's full-sized avatar
🎯
Focusing

Pavel paveljurca

🎯
Focusing
View GitHub Profile
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class GameTest {
private Game game;
private GameSchema plot;
@Before
#!/usr/bin/perl
use strict;
use warnings;
# http://stackoverflow.com/questions/30914955/a-perl-one-liner-into-a-bash-function
for (reverse 0..(shift)*60-1) {!system q!clear! and open(FIGLET,q!|figlet -f banner -c!) and printf FIGLET "%2d'%02d",$_/60,$_%60;sleep 1}
@paveljurca
paveljurca / ModernPerl.tmTheme
Last active October 20, 2015 20:02
Sublime Text 3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Darkside</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@paveljurca
paveljurca / cron.sh
Last active November 26, 2017 23:55
bazar.fotoskoda.cz watchdog
#!/bin/bash
bazaar=$( perl fotoskoda.pl )
# new stuff arrived
if [ "$bazaar" > /dev/null ]; then
# send me an email
echo "$bazaar";
fi;
@paveljurca
paveljurca / diamond.pl
Last active December 14, 2015 17:52
reading by diamond, which file you're in then?
use v5.10;
# diamond and @ARGV
# to be continued...
@ARGV = <*.js>;
say $ARGV[0];
while (<>) {
say $ARGV[0] if eof;
# say $. if eof;
}
use strict;
use warnings;
use v5.10;
for (my $i=1; $i < @ARGV; $i++) {
($ARGV[$i], $ARGV[$i-1]) = ($ARGV[$i-1], $ARGV[$i]) if $ARGV[$i-1] > $ARGV[$i];
}
say $ARGV[-1] || 'no numbers';
@paveljurca
paveljurca / params.pl
Created December 14, 2015 18:22
make JSON to URL
use strict;
use warnings;
my $param;
while (<DATA>) {
chomp;
#s/^\s+|\s+$/g;
$param .= (join "=", split /:/)."&";
}
$param =~ s/[\s',]+//g;
@paveljurca
paveljurca / simplecast.pl
Last active November 20, 2017 21:06
download the podcast mp3s from given simplecast.fm
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
use constant API
=> 'http://simplecast.fm/podcasts/1446/rss';
my @html = split m|<title>|,
LWP::UserAgent->new->request(GET API)->decoded_content;
use strict;
use warnings;
use LWP::UserAgent;
use open qw/:std :utf8/;
use autodie;
use IPC::Open2;
# knihovna VC
@paveljurca
paveljurca / all_text.pl
Created February 23, 2016 19:43
WordPress to text
use strict;
use warnings;
use LWP::Simple;
use Mojo::DOM;
use open qw/:std :utf8/;
use utf8;
URL:
for my $url (<DATA>) {
chomp $url;