Skip to content

Instantly share code, notes, and snippets.

View weburnit's full-sized avatar
🏠
Working from home

Paul Aan weburnit

🏠
Working from home
View GitHub Profile
@weburnit
weburnit / StarWar-challenge.js
Created February 10, 2017 05:52
Star War Challenge - Jedi vs Sith
/*
# StarWar Challenge
## Summary:
The Sith have sent Lord Malice to find the last standing Jedi temple on an unknown planet.
We need to find what planet it is on before he does.
## Intel:
@weburnit
weburnit / starwar.js
Last active February 10, 2017 05:59
Starwar Challenge
function standardDeviation(values) {
var avg = average(values);
var squareDiffs = values.map(function (value) {
var diff = value - avg;
var sqrDiff = diff * diff;
return sqrDiff;
});
<?php
class ApplicationEngine
{
/**
* @var InterpreterInterface[]
*/
private $interpreters = [];
<?php
interface BackupPowerDelegateInteface
public function successTurnonPowerBackup();
public function successTurnonPowerBackup();
}
@weburnit
weburnit / Delegation.php
Last active October 9, 2015 04:58
Delegation
<?php
class OfficeDelegation implement BackupPowerDelegateInteface, PrinterDelegateInterface
{
public function duringOfficeLogic()
{
if($this->powerIsOff()){
$backupPower = new BackupPowerHandler();
$backupPower->setDelegate($this);