Skip to content

Instantly share code, notes, and snippets.

Avatar

Dezső BICZÓ mxr576

View GitHub Profile
@mxr576
mxr576 / Dockerfile
Last active June 3, 2023 16:20
DDQG Composer Audit Docker image with Composer Audit Changes plugin
View Dockerfile
################################################################################
# DDQG Composer Audit Docker image with Composer Audit Changes plugin.
#
# Usage:
# - docker buildx build --tag mxr576/ddqg_composer_audit:latest .
# - docker run --rm -ti -v [PATH_TO_COMPOSER_PROJECT_ROOT]:/app -v ${COMPOSER_HOME:-$HOME/.composer}/cache:/tmp/composer/cache mxr576/ddqg_composer_audit:latest audit -d /app
#
# See further ideas at https://hub.docker.com/r/composer/composer
#
# Simplified and customized version of https://github.com/composer/docker/blob/cc32c94811040536eb15e46c251a5ee36d5da1ea/2.5/Dockerfile
View gist:7f711c39d9e7ed614175505b3344f12f
<?php
/**
* @file
* Dumping ground for stubs, until a pattern emerges.
*/
declare(strict_types=1);
namespace Drupal\datetime\Plugin\Field\FieldType {
@mxr576
mxr576 / README.md
Created November 7, 2022 12:34 — forked from mpdude/README.md
Use `jq` to tweak `composer.json` requirements
View README.md

Change Symfony requirements in composer.json

This took me two hours on stackoverflow.com, so I'm going to document it to future me:

In the composer.json require section, for all packages starting with symfony/, but not for symfony/monolog-bundle, change the required version to the value of the $VERSION environment variable.

Write out the updated composer.json file in a way that works _without sponge`, which is not installed on GitHub Action runners by default.

@mxr576
mxr576 / Custom Nginx preset.md
Created October 18, 2022 12:09
How to setup basic auth in DrupalDev (Wodby Nginx)
View Custom Nginx preset.md
@mxr576
mxr576 / .eslintrc.yml
Created June 27, 2022 06:25
Experimenting with linting yaml-s with eslint-plugin-yml
View .eslintrc.yml
extends:
- plugin:yml/standard
rules:
yml/block-mapping:
- error
- always
yml/block-sequence:
- error
- always
yml/quotes:
@mxr576
mxr576 / check_config_changes.sh
Last active June 15, 2022 14:44
Drupal: Check config changes caused by https://www.drupal.org/node/3230199
View check_config_changes.sh
##############################################################################
# This is a KISS script to compare configuration changes caused by https://www.drupal.org/node/3230199
# Make sure https://github.com/homeport/dyff is installed before you use this.
# License GPL-2.0-or-later.
###############################################################################
#!/usr/bin/env bash
echo "Enter the path of the original config directory, e.g.: /foo/bar/build/config"
read -r old_config_dir
@mxr576
mxr576 / Annotation_MyModuleEntityType.php
Last active September 4, 2021 18:14
"Smart" (content) entity type base in Drupal 8/9/10?
View Annotation_MyModuleEntityType.php
<?php
declare(strict_types = 1);
namespace Drupal\my_module_entity\Annotation;
use Drupal\Core\Entity\Annotation\EntityType;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\my_module_entity\Entity\MyModuleEntityType as MyModuleEntityTypeClass;
@mxr576
mxr576 / onion-arch-symfony-app.md
Created May 23, 2021 13:31
Code organization example of an onion-based Symfony app
View onion-arch-symfony-app.md
// source: https://blog.itsjavi.com/target-software-architectures-the-onion-architecture
/tests
/src
    /Application
        /UseCase
            /CreateOrder
                CreateOrderRequest
                CreateOrderResponse
                CreateOrderUseCase
@mxr576
mxr576 / ddd_cqrs_event-sourcing_in_php.md
Created January 31, 2021 11:15 — forked from jsor/ddd_cqrs_event-sourcing_in_php.md
DDD, CQRS and Event Sourcing in PHP
View ddd_cqrs_event-sourcing_in_php.md

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@mxr576
mxr576 / benchmark.php
Created May 9, 2019 07:49
is_a() vs. reflection benchmark
View benchmark.php
<?php
$cnt = 10000000;
interface FooInterface {}
class BarClass implements FooInterface {
}
$x = 0;