Skip to content

Instantly share code, notes, and snippets.

public String calculateMdes(String thing) {
// do whack shit
return something;
}
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class FooTest {

Keybase proof

I hereby claim:

  • I am beresfordt on github.
  • I am beresfordt (https://keybase.io/beresfordt) on keybase.
  • I have a public key whose fingerprint is C4D8 32FB B12D A747 A71A 1222 8935 6160 30FE 0897

To claim this, I am signing this object:

@beresfordt
beresfordt / D.java
Created September 15, 2015 20:56
javac barf
public class D<P> implements Type<Type<? super D<D<P>>>> { }
@beresfordt
beresfordt / Requirements.md
Last active September 12, 2015 20:12
http://thinknation.ca/ stock price challenge

Stock Price

Given a list of yesterday stock prices from standard in (stdin), where each ith number represents value of the stock at ith minutes past trade opening time, which was 9:30am local time . The market close at 4:30pm local time.

For example: The 60th number is value of the stock at 10:30am

Write an efficient algorithm and print to standard out (stdout) the best profit you could have made from 1 purchase and 1 sale of 1 stock yesterday

You must buy before you can sell meaning you must wait at least 1 minute after you purchase the stock before you can sell it.

Sample Input

@beresfordt
beresfordt / testMaker.pl
Last active December 18, 2015 10:10
Noddy script to create skeleton Test::Class test classes for existing classes. Based on structure as defined in ovid's excellent Test::Class tutorial here: http://www.modernperlbooks.com/mt/2009/03/organizing-test-suites-with-testclass.html
#!/usr/bin/env perl
use strict;
use warnings;
use autodie;
use File::Path qw(make_path);
my $infile = shift;
open(my $fh, '<', $infile);
@beresfordt
beresfordt / ldap_funcs.pl
Created September 4, 2012 12:04
Some LDAP functions
#!/usr/bin/perl
use strict;
use autodie;
use warnings;
use Data::Dumper;
use Net::LDAP;
my $uid = 'some.user' ;
my $upass = 'nonono';
@beresfordt
beresfordt / n2s-s2n.pl
Created April 23, 2012 10:36
Perl convert string to num and num to string
#!/usr/bin/perl
use strict ;
use warnings ;
my $string = 'some text' ;
my $num = '115,111,109,101,32,116,101,120,116' ;
strToNum($string) ;
numToStr($num) ;
@beresfordt
beresfordt / eval.pl
Created April 22, 2012 11:38
Returning from within perl exception handling
#!/usr/bin/perl
use autodie ;
use strict ;
use warnings ;
use Test::More tests => 2 ;
testEval() ;
sub testEval{
#!/usr/bin/perl
use Getopt::Std;
use Data::Dumper;
%args;
getopts('sgh:', \%args);
if ($args{h}) {
print "foo\n" ;