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 5.010; | |
use BuildForge::Services; | |
use Try::Tiny; | |
use Config::Simple; | |
my $cfg = Config::Simple->new( $0 . '.cfg' ); |
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 5.016; | |
use JenkinsRC; | |
my $jenkins = JenkinsRC->new( url => $ENV{'JENKINS_URL'} ); | |
my @jobs = @ARGV; | |
for my $job (@jobs) { | |
my $def = $jenkins->get($job); | |
say $def; |
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 Modern::Perl; | |
say "$_ : " . $ENV{$_} for ( sort keys %ENV ); | |
say ""; | |
say "System PATH for $^O"; | |
say ""; | |
my $pathdel; |
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 5.010; | |
use strict; | |
use warnings; | |
use XML::OPML::LibXML; | |
use HTTP::Tiny; | |
use Path::Class; | |
my $url = "https://raw.github.com/mlbright/myopml/master/subs.xml"; |
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 5.010; | |
use strict; | |
use warnings; | |
my $n = 21 * 12; # remaining amortization in number of months | |
my $ingblended = 3.84; | |
my $ingbroken = 3.08; | |
my $tdrate = 2.79; |
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/python | |
# Does this work? | |
# http://blog.jgc.org/2013/04/the-minimum-coin-problem-with-prize.html | |
coins = [200,50,50,100,100,20,20,20,10,5,5,2,2,1,1] | |
coins.sort() | |
coins.reverse() | |
paper = 170 |
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 5.010; | |
use strict; | |
use warnings; | |
use HTTP::Tiny; | |
my $ratings = 'http://jenkins-ci.org/rate/result.php'; | |
my $response = HTTP::Tiny->new->get($ratings); |
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 5.010; | |
use strict; | |
use warnings; | |
use File::Path qw (remove_tree); | |
while ( my $path = <> ) { | |
chomp $path; | |
my $errors; |
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 5.010; | |
use strict; | |
use warnings; | |
use Flickr::Upload; | |
use File::Spec; | |
use File::Find; | |
use Config::Simple; | |
use Path::Class; |
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
# Calculate the expected percentage of pairs of socks recovered | |
# after randomly washing a sample | |
from random import shuffle, sample | |
from collections import defaultdict | |
from time import clock | |
PAIRS = 20.0 | |
EXPERIMENTS = 1000000 |