Skip to content

Instantly share code, notes, and snippets.

View makomweb's full-sized avatar
馃

Martin Komischke makomweb

馃
View GitHub Profile
@makomweb
makomweb / docker.sh
Last active October 10, 2023 15:31
Remove docker images / containers
# Remove Image
docker rmi <imageId/Name>
# Force remove image
docker rmi -f <imageId/Name>
# Remove dangling images
docker image prune
# Remove all images
@makomweb
makomweb / reflection-test.php
Last active November 30, 2023 12:04
Reflecting a PHP class and it's attributes (traverse properties and attributes)
<?php
declare(strict_types=1);
namespace App\Tests\Unit\Playground;
use Attribute;
use PHPUnit\Framework\TestCase;
use ReflectionAttribute;
use ReflectionClass;
@makomweb
makomweb / Dockerfile
Created March 25, 2024 12:29
Docker multi stage file for npm + webserver
# Docker multistage
# 1. stage to run npm install
# 2. stage to create a webserver image with the build artifact from stage 1
FROM node:latest as build-stage
WORKDIR /app
COPY ./ /app/
@makomweb
makomweb / solid.md
Last active October 14, 2025 06:09
SOLID principles

SOLID

Single responsible principle

  • a module should be responsible to one, and only one, actor
  • a class should have only one reason to change
  • solves the problem of God objects, tight coupling and change chains (and more)
Solution: Don't rely on technology but rely on functionality (feature)!