Skip to content

Instantly share code, notes, and snippets.

Andrew Hayes AndrewRussellHayes

Block or report user

Report or block AndrewRussellHayes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View perl numeric hash key sort.pl
foreach my $distance (sort {$a <=> $b} keys %planets) {
say $distance;
}
@AndrewRussellHayes
AndrewRussellHayes / sort hash keys.pl
Last active Aug 29, 2015
for each keys in sort hash alphabetic sort
View sort hash keys.pl
foreach my $name (sort keys %planets) {
printf "%-8s %s\n", $name, $planets{$name};
}
View docker startup
$ boot2docker init
$ boot2docker start
$ export DOCKER_HOST=tcp://$(boot2docker ip 2>/dev/null):2375
View bool to string.sql
v_str := CASE WHEN p_Success_Check THEN 'TRUE' ELSE 'FALSE' END;
@AndrewRussellHayes
AndrewRussellHayes / extRename.sh
Created Sep 12, 2014
rename group of files by file extension
View extRename.sh
for file in *.cdf.cntrl; do mv "$file" "`basename $file .cdf.cntrl`.cntrl"; done
@AndrewRussellHayes
AndrewRussellHayes / Package.sql
Created Aug 21, 2014
combined spec and body package template
View Package.sql
CREATE OR REPLACE PACKAGE BFH2_TEMPLATE
AS
/*
AUTHOR: Joe Developer
PACKAGE NAME: TEMPLATE SPEC
CREATION DATE: MM/DD/YYYY
PURPOSE:
DEPENDENCIES:
CHANGELOG:
View PackageBody.sql
CREATE OR REPLACE PACKAGE BODY BFH2_TEMPLATE
AS
/*
AUTHOR: Joe Developer
PACKAGE NAME: TEMPLATE BODY
CREATION DATE: MM/DD/YYYY
PURPOSE:
DEPENDENCIES:
CHANGELOG:
@AndrewRussellHayes
AndrewRussellHayes / read.pl
Last active Oct 21, 2015
file I/O best practices
View read.pl
my $filename = 'data.txt';
if (open(my $in, '<', $filename)) {
while (my $row = <$in>) {
chomp $row;
print "$row\n";
}
} else {
warn "Could not open file '$filename' $!";
}
View novimrc
"run current perl program
set autowrite
"map <F4> :! perl /cbm/BFH2/APP/Dev.pl<CR>
"map <F5> :! perl ./%<CR>
"map <F5> :! perl /cbm/BFH2/APP/Worker.pl<CR>
map <F2> :pm<CR>
map <F3> :! perl -wc /cbm/BFH2/LIB/WORKERS/XMLQuery.pm<CR>
map <F4> :! perl /cbm/BFH2/APP/Dev.pl<CR>
map <F5> :! perl /cbm/BFH2/APP/Worker.pl 5<CR>
command Ct cd %:p:h
@AndrewRussellHayes
AndrewRussellHayes / procedure.sql
Created Jul 9, 2014
pl/sql procedure template
View procedure.sql
/*
AUTHOR:Joe Developer
ACCEPTS:These Args
DOES:Performs Function
RETURNS:Return Value
DEPENDENCIES:Uses/Needs
NOTES: Special Considerations
*/
CREATE [OR REPLACE] PROCEDURE procedure_name
[ (parameter [,parameter]) ]
You can’t perform that action at this time.