Skip to content

Instantly share code, notes, and snippets.

View jsarenik's full-sized avatar

Ján Sáreník jsarenik

View GitHub Profile
open F, $opt{src_file} or die "Cannot open file `$opt{src_file}': $!";
my $counter=0;
my $record = "";
while (<F>) {
$counter++, process_record($record), $record = "" if /\d{4}\.\d{2}\.\d{2} \d
$record .= $_;
}
# Process last record
#!/bin/sh
echo This is Interactive Perl shell
rlwrap -A -pgreen -S"perl> " perl -wnE'say eval()//$@'
#!/bin/sh -e
# SUM is any command that produces following output:
# <sum> <file>
#SUM="md5 -r"
SUM="md5sum"
# F is output file for the list of files found by sumfiles
F=/tmp/dupfind.tmp
FINDPTH="."
#!/usr/bin/perl
# As appeared at http://stackoverflow.com/questions/298314/find-files-in-git-repo-over-x-megabytes-that-dont-exist-in-head
use 5.008;
use strict;
use Memoize;
sub usage { die "usage: git-large-blob <size[b|k|m]> [<git-log args ...>]\n" }
@ARGV or usage();
my ( $max_size, $unit ) = ( shift =~ /^(\d+)([bkm]?)\z/ ) ? ( $1, $2 ) : usage();
#!/bin/sh
perl -pe 's/\$(\w+)/$ENV{$1}/g' file.sh
#!/usr/bin/perl
# As appeared at http://stackoverflow.com/questions/298314/find-files-in-git-repo-over-x-megabytes-that-dont-exist-in-head
use 5.008;
use strict;
use Memoize;
sub usage { die "usage: git-large-blob <size[b|k|m]> [<git-log args ...>]\n" }
@ARGV or usage();
my ( $max_size, $unit ) = ( shift =~ /^(\d+)([bkm]?)\z/ ) ? ( $1, $2 ) : usage();
#!/bin/sh
obj_name="$1"
shift
git log "$@" --pretty=format:'%T %h %s' \
| while read tree commit subject ; do
if git ls-tree -r $tree | grep -q "$obj_name" ; then
echo $commit "$subject"
fi
done
BEGIN {
FS="|";
OFS=";;";
moj="";
oldRT="";
}
{
gsub(/ahoj/, "kvak", $1);
#$1 = gsub(/>\s+/, ">", $1);
#$1 = gsub(/\s+</, "<", $1);
perl -d -e 1
export ORACLE_HOME=$(find /usr/lib/oracle/ -name client64 | tail -1)
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
grep CATALOG_VERSION_NO src/include/catalog/catversion.h
use warnings;
use Data::Dumper;
sub a { 5 };
%a = (a=>1,'b',2);
@b = ('a'=>1=>'b'=>2);
print Dumper %a;
#print $a{'a'},"\n";
print Dumper @b;