Skip to content

Instantly share code, notes, and snippets.

View springerin's full-sized avatar
🏠
Working from home

Andra E. Lungu springerin

🏠
Working from home
View GitHub Profile
@htuscher
htuscher / post_deploy.sh
Created March 25, 2020 16:02
Shopware 6 post deployment steps
#!/usr/bin/env bash
bin/console cache:clear
bin/console database:migrate --all
bin/console plugin:refresh
# Ensure plugins are installed and active
bin/console plugin:install --activate FroshPlatformMailArchive
bin/console plugin:install --activate FroshPlatformTemplateMail
@Potherca
Potherca / README.md
Last active March 10, 2025 12:44
HOWTO: Skip files outside PhpStorm project in Xdebug sessions

Introduction

In PHP development environments, it is not entirely uncommon to use an auto_prepend_file to add development-specific functionality to an application. Usually such a file is used for several projects at the same time. This means the prepend file resides somewhere in a more high-level location.

A more common practice is to use Xdebug te debug PHP code.

When combining these two with PhpStorm this will lead to the prepend file being marked as "not mapped".

Problem

@rafaelstz
rafaelstz / Magento2-API-OAuth-based_authentication.php
Last active September 8, 2023 06:15
Sample files to use Magento 2 REST and SOAP API. Using Token-based authentication and OAuth-based authentication method.
<?php
function sign($method, $url, $data, $consumerSecret, $tokenSecret)
{
$url = urlEncodeAsZend($url);
$data = urlEncodeAsZend(http_build_query($data, '', '&'));
$data = implode('&', [$method, $url, $data]);
$secret = implode('&', [$consumerSecret, $tokenSecret]);
@balloz
balloz / fix-broken-unserialize.diff
Last active August 19, 2019 14:01
Fix broken unserialize in Magento SUPEE-8788 patch
diff --git a/lib/Unserialize/Parser.php b/lib/Unserialize/Parser.php
index 20a6a3c..88c6555 100644
--- a/lib/Unserialize/Parser.php
+++ b/lib/Unserialize/Parser.php
@@ -34,6 +34,7 @@ class Unserialize_Parser
const TYPE_DOUBLE = 'd';
const TYPE_ARRAY = 'a';
const TYPE_BOOL = 'b';
+ const TYPE_NULL = 'N';
@birchestx
birchestx / install_magento2_with_db
Last active December 15, 2017 17:22
Install script for magento2 with database, assumes you are running from www.localhost.com/20
#!/bin/bash
# Sets up a database with a magento2 installation. This assumes you are running from under your httpdocs/<release> location and have www.localhost.com in your /etc/hosts file
# To run type : install_magento2 <dirname> <password> <release>
# password is used for the datbase user and the magento admin password
if [ $# -eq 0 ]; then
echo "No arguments supplied"
echo "Usage: `basename $0` <dirname> <password> <release>"
echo "e.g install_magento2.sh mage2 password 21"
exit 1
@Vinai
Vinai / M2 acl.xml
Last active February 27, 2025 20:36
My current Magento 2 PHPStorm File Templates (Feb 2016)
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
</resource>
</resources>
</acl>
</config>
@jaywilliams
jaywilliams / .htaccess
Last active June 7, 2018 16:09
Magento 2 SSL Redirect Loop Fix (Apache + Varnish + Nginx)
# Add this to your the Magento .htaccess file located in your docroot
############################################
## Nginx proxy HTTPS Fix for Magento
## Source: https://www.sonassi.com/blog/magento-kb/magento-https-redirect-loop-2
SetEnvIf X-Forwarded-Proto https HTTPS=on
@Vinai
Vinai / or-example.php
Last active September 28, 2021 20:48
SearchCriteria OR Example for Magento 2
<?php
declare(strict_types = 1);
namespace Training5\VendorRepository\Controller\Test;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Framework\Api\Filter;
use Magento\Framework\Api\FilterBuilder;
@aleron75
aleron75 / load_media_gallery
Created May 19, 2015 10:26
Load Magento product media gallery
@sandermangel
sandermangel / price.phtml without Weee
Last active November 13, 2018 15:13
The price.phtml template without all the Weee stuff
<?php
/**
* Updated price.phtml without WEEE
*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* http://opensource.org/licenses/mit-license.php
*