Skip to content

Instantly share code, notes, and snippets.

@6ui11em
6ui11em / recirect.txt
Created June 1, 2021 06:10
.htaccess: Redirect all to index.html #htaccess #redirect
RewriteEngine On
RewriteBase /
RewriteRule ^index.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
@6ui11em
6ui11em / csp_whitelist.xml
Created June 18, 2021 14:33
Magento 2: Content Security Policy XML #magento2 #content-security #whitelist #csp
<?xml version="1.0" encoding="UTF-8"?>
<!--
The HTTP Content-Security-Policy response header allow you to control what pages to load for specific
user agents.
This mostly involves defining rules for specific origins or script endpoints, and helps guard against
cross-site scripting attacks (XSS).
-->
<csp_whitelist
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@6ui11em
6ui11em / Magento 2 - Remove all customer data
Created December 14, 2021 14:26 — forked from rafaelstz/Magento 2 - Remove all customer data
Remove all Magento 2 test Sample Data
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE `customer_entity`;
TRUNCATE TABLE `customer_entity_datetime`;
TRUNCATE TABLE `customer_entity_decimal`;
TRUNCATE TABLE `customer_entity_int`;
TRUNCATE TABLE `customer_entity_text`;
TRUNCATE TABLE `customer_entity_varchar`;
TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
@6ui11em
6ui11em / magento2-apply-combine-conditions.php
Last active May 19, 2022 11:01
Magento 2: Aplicar conditions al collection #mageno2
<?php
use Magento\Rule\Model\Condition\Sql\Builder as SqlBuilder;
...
/** @var $collection Collection */
$collection = $this->productCollectionFactory->create();
$conditions = $this->getConditions();
$productConditions = $this->getProductConditions();
$conditions->collectValidatedAttributes($collection);
@6ui11em
6ui11em / creative-cloud-disable.md
Created December 27, 2022 08:52 — forked from andreibosco/creative-cloud-disable.md
disable creative cloud startup on mac
@6ui11em
6ui11em / magento2_query_product_no_image.sql
Created October 3, 2023 17:05
Magento 2: Query products without image
SELECT * FROM `catalog_product_entity` WHERE `entity_id` NOT IN (SELECT `entity_id` FROM `catalog_product_entity_media_gallery_value_to_entity`) AND `entity_id` IN (SELECT entity_id FROM `catalog_product_entity_int` WHERE attribute_id = ( SELECT attribute_id FROM `eav_attribute` WHERE `attribute_code` = 'status' ) AND `catalog_product_entity_int`.value = 1)