Skip to content

Instantly share code, notes, and snippets.

View mehdichaouch's full-sized avatar
🤖
Happiness Developer

Mehdi Chaouch mehdichaouch

🤖
Happiness Developer
View GitHub Profile
@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 = [
@mehdichaouch
mehdichaouch / README.md
Last active November 30, 2023 17:33
🔧 WordPress Plugins Compatibility from command line with WP-CLI
@tschallacka
tschallacka / Seeder.php
Created November 2, 2022 19:39
Bigbridge importer example
<?php
declare(strict_types=1);
use Symfony\Component\Console\Output\OutputInterface;
use BigBridge\ProductImport\Api\Importer;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use BigBridge\ProductImport\Api\Data\SimpleProduct;
use BigBridge\ProductImport\Api\Data\SimpleProductFactory;
use BigBridge\ProductImport\Api\ImportConfigFactory;
use BigBridge\ProductImport\Api\ImporterFactory;
@SeanCannon
SeanCannon / dnsmasq OS X.md
Created July 14, 2022 02:20 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@vbuck
vbuck / magento-config-diff-generator.php
Created March 18, 2021 15:12
Calculate the diff between 2 Magento core_config_data tables and generate as SQL
<?php
namespace MagentoTools;
class Generator
{
private $config = [
'type' => CsvSnapshotConfig::class,
'left' => null,
'right' => null,
@FredericMartinez
FredericMartinez / tinymce4Adapter.js
Last active March 17, 2021 15:10
Remove <p> WYSIWYG Magento 2
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*
* => app/design/adminhtml/Namespace/project_name/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js
*/
/* global popups, tinyMceEditors, MediabrowserUtility, Base64 */
/* eslint-disable strict */
define([
@zulhfreelancer
zulhfreelancer / delete-github-actions-runs.sh
Last active October 11, 2022 13:01
Delete all GitHub Actions runs
# ===========================================================================
# Requirements
# * gh CLI: https://cli.github.com (make sure you are logged-in to the CLI)
# * jq CLI: https://stedolan.github.io/jq
# ===========================================================================
export TARGET_USER=github_user_or_org
export TARGET_REPO=github_repo_name
while :
@fvln
fvln / Jouons avec le phishing Paypal.md
Last active January 7, 2021 11:02
Quelques observations sur les attaques par phishing ciblant Paypal

Jouons avec le phishing Paypal

Courant septembre, j'ai testé un développement qui cherche des patterns parmi (les certificats TLS venant d'être délivrés publiquement)[http://certstream.calidog.io/]. La limite de cette recherche, c'est qu'elle s'applique sur des noms de domaines et pas des URL complètes ! Il suffit de filtrer ces certificats avec le mot-clé « paypal » pour obtenir des dizaines de noms de domaines malveillants par jour, avec parfois... juste un .zip à la racine. Comme j'en ai attrapé quelques-uns (ici 16shop), c'est l'occasion de les décortiquer ;)

Comment ça marche ?

Essayons de comprendre comment les attaquants travaillent !

@MaximeCulea
MaximeCulea / wp-cli-languages.sh
Last active January 31, 2023 13:36
Play with WordPress languages in cli.
#!/bin/bash
# Note the fifference between Install and Update
# Install : if the language doesn't exist, this is the first step to get the last asked language package. It is also needed, in order to update.
# Update : will get the last asked translation package, only if the language is already installed.
# Install core in french if not existing
wp language core install fr_FR
# Update all existing core languages