Skip to content

Instantly share code, notes, and snippets.

View sprankhub's full-sized avatar

Simon Sprankel sprankhub

View GitHub Profile
@sprankhub
sprankhub / bitbucket-pipelines.yml
Last active August 18, 2021 00:09
Bitbucket Pipelines Configuration To Run Various Magento 2 Tests
image: php:7.2-apache
pipelines:
pull-requests:
'**':
- parallel:
- step:
name: Linting & Static Checks & Unit Tests
caches:
- composer
script:
@sprankhub
sprankhub / gist:a386a2969ca7cc6f6552
Created November 6, 2015 12:26
Fish Shell Autocompletion for the Magento 2 Shell Script
# Installation:
# Copy to ~/.config/fish/completions/magento.fish
# Open new or restart existing shell session
# Commands based on Magento 2.0.0-rc and the command
# bin/magento --raw --no-ansi list
# It is a static list since you probably do not have the magento shell script
# in your path.
complete -f -c magento -a --help;
complete -f -c magento -a -h;
@sprankhub
sprankhub / magento-1.9.2.0-1.9.2.1.diff
Last active August 29, 2015 14:26
Magento 1.9.2.0 - 1.9.2.1 Diff
diff -rw magento1920/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php magento1921/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php
236,238c236,238
< $phpAuthUser = $this->getController()->getRequest()->getServer('PHP_AUTH_USER', false);
< $phpAuthPw = $this->getController()->getRequest()->getServer('PHP_AUTH_PW', false);
< $scheme = $this->getController()->getRequest()->getScheme();
---
> $phpAuthUser = rawurlencode($this->getController()->getRequest()->getServer('PHP_AUTH_USER', false));
> $phpAuthPw = rawurlencode($this->getController()->getRequest()->getServer('PHP_AUTH_PW', false));
> $scheme = rawurlencode($this->getController()->getRequest()->getScheme());
diff -rw magento1920/app/code/core/Mage/Catalog/etc/api.xml magento1921/app/code/core/Mage/Catalog/etc/api.xml
@sprankhub
sprankhub / trustbadge.js
Last active December 14, 2016 07:00
Responsive Trusted Shops Trustbadge
// make sure that $j is your jQuery function or customise accordingly
// make sure that "trustbadge" is the ID of your custom trusted shops container or customise accordingly
$j(window).on("load resize", function(e) {
// responsive Trusted Shops badge
var trustbadgeContainerWidth = $j('#trustbadge').width();
// trusted shops ignores the customBadgeWidth, so set the height accordingly
_tsConfig.customBadgeHeight = (90/264) * trustbadgeContainerWidth;
// on a normal load event, the badge is loaded afterwards anyway
if (e.type == 'resize' && typeof trustbadge == 'object' && typeof trustbadge.reInitialize == 'function') {
@sprankhub
sprankhub / update_product_categories.php
Created February 6, 2015 10:27
Magento Script To Activate Products of Child Categories in the Parent Category
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
// only allow php CLI execution
if (php_sapi_name() !== 'cli') {
exit;
}