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/env perl | |
use strict; | |
use warnings; | |
use feature qw(say switch); | |
###################################################################### | |
package HashOfHash; | |
use Moose; |
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/env perl | |
use strict; | |
use warnings; | |
use feature qw(say); | |
######################################################################## | |
package QS; |
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/env perl | |
# Solution to a question in @gayle's "Cracking the Coding Interview" 5th ed. | |
# A child is running up the stairs and can take 1, 2 or 3 steps at a time. | |
# Count how many possible ways the child can run up the stairs. | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use feature qw/ say /; |
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/env perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use feature qw /say/; | |
package Node; | |
use Moose; |
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
PERLDOC="-otext" perldoc perllocal | grep Module | awk '{print $7}' |
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
# Assuming you only require from index.js | |
# and you use const | |
# and you use const at the beginning of a line | |
# and there aren't other things like child_process to filter out | |
npm install $(egrep ^'const(.*)= require' index.js | egrep -v '/|child_process' | cut -f2 -d\' | xargs) |
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
p=1000;l=72;t=3;c=",";n="\n";z=0;w=" ";e=f="";P=p%l;(1..(4*l/t-(2+P+(P/t).floor))).each{|i|f+=w};(1..p).each{|i|q=(p-i+1);print(((i==1)?f.to_s+1.to_s():e)+(((q%t== 0)?c+((q%l==0)?n:e):e)+z.to_s)+((i==p)?n:e))}; |
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
ctf api CollabNet->getProjectListForUser USERNAME | |
foreach | |
do | |
copy as project | |
mkdir "$project.title" | |
tools wiki | |
foreach | |
do | |
copy as wiki | |
if wikitext |
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
# Find all RPMs of libraries for binaries in this folder | |
rpm -qf $(ldd * | grep = | awk '{print $3}' | sort -u | grep ^/) | sort -u | |
# Similarly, for all .so files under this folder | |
rpm -qf $(find . -name \*.so -exec ldd {} \; | grep = | awk '{print $3}' | sort -u | grep ^/) | sort -u |
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
# replace with your variable name | |
variable=$(echo ${variable} 1 + f | dc) |