- Abstract Class
- Abstraction (hiding details) (OK)
- Aggregation (HAS-A) (OK)
- Better Architecture (OK)
- Class (OK)
- Cleaner Code (OK)
- Conceptualization (OK)
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 Brainfuck | |
{ | |
public $ref; | |
function &__get($x) { | |
$this->ref = new class($this->ref) { | |
private $p; |
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 | |
use \Psr\Http\Message\ServerRequestInterface as Request; | |
use \Psr\Http\Message\ResponseInterface as Response; | |
require 'vendor/autoload.php'; | |
$app = new \Slim\App; | |
$app->get('/hello/{name}', function (Request $request, Response $response) { | |
$name = $request->getAttribute('name'); | |
$response->getBody()->write("Hello, $name"); |
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 | |
/** | |
* Swagger Petstore (Simple) | |
* @version 1.0.0 | |
*/ | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$app = new Slim\App(); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Layout</title> | |
</head> | |
<body> | |
<header> | |
<h1>This is the Title of the Content</h1> | |
</header> |
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
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}footer,nav{display:block}a{background-color:transparent}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}button,input,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible;text-transform:none;-webkit-appearance:button;cursor:pointer}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html,body{height:100%}html{box-sizing:border-box}*,:before,:after{-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit}html,body{font-size:100%}body{background:#fff;color:#222;cursor:auto;font-family:"Helvetica Neue",Helvetica,Roboto,Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.5;margin:0;padding:0;position:relative}a:hover{cursor:pointer}.right{floa |
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
<!-- Defines element markup --> | |
<template> | |
<form> | |
<fieldset> | |
<label for="name">Name</label> | |
<input type="text" placeholder="Meal Name" id="name" name="name"> | |
<label for="date">Date - Time</label> | |
<input type="date" placeholder="Set Date" id="date" name="date"> | |
<input type="time" placeholder="Set Time" id="time" name="time"> | |
<label for="calories">Calories</label> |
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
/* | |
* 5 or 0b101 should return $array[0] and $array[2] | |
* If array is bigger than 64 elements, filter will not work. | |
* consider dividing filter into array of 8 bit integers. | |
* Doesn't preserve keys. | |
*/ | |
function filterArray($array, $integer){ | |
$result = []; | |
$index = 0; | |
while($integer>0){ |
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 | |
$origin = [5,4,3,2,1]; | |
$buffer = []; | |
$destination = []; | |
function moveDisks($number, array &$origin, array &$destination, array &$buffer) | |
{ | |
echo "\n\n"; | |
if($number <= 0) return; |
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 | |
function tail($filename, $numberOfLines){ | |
$counter = 0; | |
$handler = fopen($filename, 'r'); | |
$end = filesize($filename); | |
$start = -1; | |
$current = $start; | |