Skip to content

Instantly share code, notes, and snippets.

View jansilvo's full-sized avatar
🎯
Focusing

jansilvo

🎯
Focusing
View GitHub Profile
@drupol
drupol / parse-commit-log.php
Last active September 19, 2020 11:11
Parse commit log with loophp/collection
<?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 {

Learning Plan for Design Patterns and Principles of Good Design

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.
@Pen-y-Fan
Pen-y-Fan / Test Driven Development (TDD) Learning Plan.md
Last active October 23, 2024 06:51
Test Driven Development (TDD)

Learning Plan for Test Driven Development (TDD)

These learning resources primarily focus on Test Driven Development (TDD).

  • There is an emphasis on learning using PHP, Laravel and PHPUnit.
  • All these resources are free (at the time of writing)
@parmindersk
parmindersk / docker_cmds.sh
Last active February 19, 2019 01:18
Shortcut commands for docker
# 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; }
@dac514
dac514 / EventEmitter.php
Last active November 4, 2022 19:52
Refactor Your Slow Form Using PHP Generators and Event Streams
<?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
{
@giansalex
giansalex / php-background.php
Created January 21, 2018 23:09
Execute $cmd in the background (no cmd window) without PHP waiting for it to finish, on both Windows and Unix.
<?php
function execInBackground($cmd) {
if (substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}
else {
exec($cmd . " > /dev/null &");
}
}
@giansalex
giansalex / docker-php-ext-install.md
Last active October 13, 2024 20:15
docker-php-ext-install Reference
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/ 
@giansalex
giansalex / docker.md
Last active July 5, 2019 14:30
Docker - steps to publish

Steps

Build

Go DockerFile's directory, run:

docker build -t local/myimage .

Build

@MustafaMagdi
MustafaMagdi / Container.php
Last active April 17, 2024 19:14 — forked from tlikai/container.php
PHP Dependency Injection Container
<?php
/**
* Class Container
*/
class Container
{
/**
* @var array
*/
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active October 26, 2024 17:40
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl