Skip to content

Instantly share code, notes, and snippets.

View jansilvo's full-sized avatar
🎯
Focusing

jansilvo

🎯
Focusing
View GitHub Profile
@nelsonsequiera
nelsonsequiera / distribution style.md
Last active January 22, 2025 01:41
redshift best suggested recommended column encoding by data types and by encoding types. column encodings: raw AZ64 Byte-dictionary Delta LZO Mostly Runlength Text255 ZSTD Data types:BOOLEAN DOUBLE SMALLINT INTEGER BIGINT DECIMAL REAL DOUBLE CHAR VARCHAR DATE TIMESTAMP TIMESTAMPTZ TIME
style use case
key same value same slice, for joins
all dimension small table for frequent joins, data is copied to all nodes first slice
even unknown cases
  • Set DISTKEY to the column most used in a JOIN
  • Set SORTKEY to the column(s) most used in a WHERE
@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 March 31, 2025 11:17
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 January 6, 2025 13:07 — forked from tlikai/container.php
PHP Dependency Injection Container
<?php
/**
* Class Container
*/
class Container
{
/**
* @var array
*/