Skip to content

Instantly share code, notes, and snippets.

Hacking elegant objects.

Mihai amihaiemil

Block or report user

Report or block amihaiemil

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

Turn the bellow mess into a proper, composable object. Each of those objects should be easily tested, replaceable and no setter should have to be called.

Context: It is an HTTP request made to one of AWS' webservices, which needs to be signed with the blood of 4 goats struck by lightning, on a fullmoon night. Bellow is the aws-java-sdk-core v1.

    //Instantiate the request
    Request<Void> request = new DefaultRequest<Void>("es"); //?!?
amihaiemil /
Last active Oct 24, 2017
2017 Award review for Java project mafagafogigante/dungeon
amihaiemil /
Last active Oct 24, 2017
2017 Award review for project DrBookings/drbookings
amihaiemil /
Last active Oct 24, 2017
2017 Award Review for mgramin/sql-boot

cd /tmp/0pdd/opencharles/charles-rest && pdd -q -f /tmp/pdd.xml20170119-1757-xqjon0: 256 (not zero):

/app/objects/exec.rb:38:in run' /app/objects/git_repo.rb:60:in xml' /app/objects/puzzles.rb:43:in deploy' /app/objects/job.rb:42:in proceed' /app/objects/job_emailed.rb:48:in proceed' /app/objects/job_detached.rb:51:in block in exclusive' /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/timeout.rb:89:in `block in timeout'

View datestime.js
* Get how much time has passed since refdate to date.
* @param date
* @param refdate
* @returns Json representing the time passed in with years, months and days.
* E.g. From 15.03.1994 to 24.05.2016 the time passed is
* 22years, 2 months and 9 days.
function timePassed(date, refdate) {
var year = date.getFullYear();
You can’t perform that action at this time.