Skip to content

Instantly share code, notes, and snippets.

@mnapoli
mnapoli / SKILL.md
Created February 6, 2026 13:26
DB transactions skill
name database-transactions
description Database transactions and pessimistic locking. Activates when working with DB::transaction, lockForUpdate, concurrent modifications, or read-modify-write patterns; or when the user mentions race conditions, locking, or data integrity.

Database Transactions & Pessimistic Locking

@mnapoli
mnapoli / reference.yml
Last active September 25, 2025 11:25
Doctrine YAML configuration reference
# Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html
MyEntity:
type: entity
repositoryClass: MyRepositoryClass
table: my_entity
namedQueries:
all: "SELECT u FROM __CLASS__ u"
# Class-Table-Inheritance
@mnapoli
mnapoli / php-hotkey.ahk
Created October 17, 2012 08:46
Autohotkey script for PHP developers on the BÉPO layout
; PHP developer shortcuts for BÉPO keyboard layouts
; Need AutoHotkey_L to support unicode encoding (http://www.autohotkey.com/download/)
; "->" for PHP (when typing <Alt>+8)
!-::
Send ->
return
@mnapoli
mnapoli / behat-reference.feature
Last active February 12, 2024 10:54
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
@mnapoli
mnapoli / README.md
Last active February 7, 2023 13:29
Bref v1 libs vs v2

Bref v1 libs (php-82-fpm):

591k  5 jan 14:50 libcurl.so.4.8.0
224k  5 jan 14:50 libnghttp2.so.14.24.1
591k  5 jan 14:50 libonig.so.5.3.0
369k  5 jan 14:50 libpq.so.5.15
355k  5 jan 14:50 libsodium.so.23.3.0
1,8M  5 jan 14:50 libxml2.so.2.10.3
142k  5 jan 14:50 libz.so.1.2.13
@mnapoli
mnapoli / Gearman-Windows.md
Last active January 5, 2023 07:58
Installing Gearman on windows

Gearman can be installed on Windows through cygwin.

Install Cygwin packages

Install cygwin packages (through setup.exe):

  • gcc
  • make
  • libuuid1-devel
  • libiconv

This code is not compatible with Bref CDK constructs:

const app = new App();

new MyStack(app, `my-stack-dev`);

Why? Bref automatically set the Bref Lambda layer on your functions. But to do that, Bref needs to know the AWS region to pick the right Bref layer ARN. When you don't set the region explicitly, then Bref cannot access the region (the region variable actually returns the ${AWS:Region} CloudFormation variable, which is useless for Bref).

FROM bref/php-80-fpm
# Include any extension you want, for example:
#COPY --from=bref/extra-gd-php-73:0.9.5 /opt /opt
ADD . $LAMBDA_TASK_ROOT
CMD [ "index.php" ]
@mnapoli
mnapoli / README.md
Last active October 22, 2021 17:13
PrettyCI migration

This page will help you run continuous integration for PHP CodeSniffer and PHP-CS-Fixer using GitHub Actions.

To setup GitHub Actions in your repository, create a .github/workflows/ci.yml file in your repository and commit it.

The content of that file depends on the tool you want to run, please read the examples below.

Note: the examples below are provided to get you started easily, it is possible you may need to adjust them to fit your project.

php-cs-fixer

@mnapoli
mnapoli / README.md
Last active January 29, 2020 16:09
Configurable Symfony container for tests

TestKernel.php:

<?php
declare(strict_types = 1);

namespace Test\Fixture;

use Symfony\Component\Config\ConfigCache;
use Symfony\Component\Config\Loader\LoaderInterface;