These learning resources primarily focus on programming using Good Design Principles and Design Patterns
- There is an emphasis on learning using PHP, although most patterns are universal to every object orientated language.
<?php | |
declare(strict_types=1); | |
include 'vendor/autoload.php'; | |
use loophp\collection\Collection; | |
use loophp\collection\Contract\Collection as CollectionInterface; | |
$commandStream = static function (string $command): Generator { |
# Remove exited instances | |
alias drm="docker ps -a | grep 'Exit\|Created' | cut -d ' ' -f 1 | xargs docker rm" | |
# View Network details | |
alias dinw="docker network inspect bridge" | |
# List images | |
alias dlsi="docker images" | |
# List containers | |
alias dpsa="docker ps -a" | |
# Remove given image | |
dirm(){ docker image rm $1 --force; } |
<?php | |
/** | |
* @license GPLv3 (or any later version) | |
* @see http://kizu514.com/blog/refactor-your-slow-form-using-php-generators-and-event-streams/ | |
*/ | |
namespace KIZU514; | |
class EventEmitter | |
{ |
<?php | |
function execInBackground($cmd) { | |
if (substr(php_uname(), 0, 7) == "Windows"){ | |
pclose(popen("start /B ". $cmd, "r")); | |
} | |
else { | |
exec($cmd . " > /dev/null &"); | |
} | |
} |
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
<?php | |
/** | |
* Class Container | |
*/ | |
class Container | |
{ | |
/** | |
* @var array | |
*/ |
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)