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
<?php | |
class OfficeDelegation implement BackupPowerDelegateInteface, PrinterDelegateInterface | |
{ | |
public function duringOfficeLogic() | |
{ | |
if($this->powerIsOff()){ | |
$backupPower = new BackupPowerHandler(); | |
$backupPower->setDelegate($this); |
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
<?php | |
interface BackupPowerDelegateInteface | |
public function successTurnonPowerBackup(); | |
public function successTurnonPowerBackup(); | |
} |
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
<?php | |
class ApplicationEngine | |
{ | |
/** | |
* @var InterpreterInterface[] | |
*/ | |
private $interpreters = []; |
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
function standardDeviation(values) { | |
var avg = average(values); | |
var squareDiffs = values.map(function (value) { | |
var diff = value - avg; | |
var sqrDiff = diff * diff; | |
return sqrDiff; | |
}); |
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
/* | |
# 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: |
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
<?php | |
class Wizeline | |
{ | |
private $range; | |
public function __construct(int $range) | |
{ | |
$this->range = $range; | |
} | |
public function printNumbers(int $numbers = null) |
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
class Wizeline(object): | |
def printNumbers(self, rangeNumber): | |
for number in range(1, rangeNumber): | |
self.printNumber(number) | |
def printNumber(self, number): | |
mod = self.getMod(number) | |
result = { | |
'15': lambda x: 'WizeLine', | |
'5': lambda x: 'Line', | |
'3': lambda x: 'Wize', |
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
brew install nodejs | |
npm install -g yarn | |
yarn add puppeteer | |
# save this content to file gobear.js | |
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); |
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
import java.io.*; | |
import java.net.*; | |
import java.util.ArrayList; | |
class WebServer { | |
// this is the port the web server listens on | |
private static final int PORT_NUMBER = 8080; | |
// main entry point for the application | |
public static void main(String args[]) { |
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
from historio import client | |
client.historio(server='grpc_address', port=5505) | |
def somewhere_else_in_your_application(): | |
user = get_current_user() #Get current user | |
assignment = DynamoDBModel() #your source model | |
#time to push | |
client.historio().push(source='assignment', source_id=assignment.id, user_id=user.id, data=model) |
OlderNewer