Skip to content

Instantly share code, notes, and snippets.

View TuVanDev's full-sized avatar

Tu Van TuVanDev

View GitHub Profile
@rhoerr
rhoerr / create_aggregated_eav_views.sql
Last active May 20, 2025 14:21
MySQL views to aggregate Magento 2 EAV data -- requires MySQL 5.7+ or equivalent
/**
* Create aggregated SQL views for default EAV entity types in Magento:
* - dev_category
* - dev_product
* - dev_customer
* - dev_address
*
* Each view has the primary entity table, plus associated EAV values (eav_int, eav_text, etc).
* This is meant as a development tool to quickly see or select scoped data for a given entity.
* Do not use these for any runtime code, and be careful about how many rows you fetch at once.
@peterjaap
peterjaap / 2.4.7-p4-most-relevant-changes-according-to-claude.txt
Last active February 13, 2025 11:40
Magento 2.4.7-p4 patch update most relevant changes according to Claude
SECURITY & VALIDATION CHANGES:
1. app/code/Magento/Customer/Controller/Account/EditPost.php
- Removed file attribute deletion functionality for security
2. app/code/Magento/Config/Plugin/Model/Config/Backend/LocalePlugin.php
- Added new plugin to validate currency code values
3. app/code/Magento/Directory/Model/Config/Backend/WeightUnit.php
- Added new backend model to validate weight unit values
@michielgerritsen
michielgerritsen / create-patch-helper-files.yml
Last active April 14, 2025 17:10
An action for GitHub Actions to run the Ampersand Upgrade Patch Helper
name: "Create patch helper files"
on:
workflow_dispatch:
inputs:
defaultBranch:
description: 'Select the branch that is used as a base'
required: true
default: 'main'
phpVersion:
@Tjitse-E
Tjitse-E / rector.php
Created January 29, 2024 13:50
Add missing dynamic properties using RectorPHP
<?php
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(CompleteDynamicPropertiesRector::class);
// Define directories to check
$directories = [
@ProcessEight
ProcessEight / Testing in Magento 2.md
Last active July 9, 2025 14:33
M2: Notes on setting up PHPUnit and writing/troubleshooting tests in Magento 2
@jbanety
jbanety / build_pcntl.sh
Last active February 6, 2024 02:50
(Updated) Build PCNTL ext for MAMP PHP 7.4.2
#!/bin/bash
PHP_VERSION=7.4.2
# Command lines tools
xcode-select --install
# Install dependencies
brew install wget autoconf openssl lzlib curl imap-uw readline postgresql gettext libxslt libiconv bison pkg-config krb5 bzip2 openldap tidy-html5
# Dirs