Skip to content

Instantly share code, notes, and snippets.

@arosenhagen
arosenhagen / magento-code-snippets.md
Last active April 8, 2024 09:21
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@arosenhagen
arosenhagen / gist:8aaf5d7f94171778c0e9
Last active February 16, 2021 11:34 — forked from supairish/gist:2951524
[nginx] limit requests from searchengine crawlers/bots to 1r/m (prevent DDOS)
http {
map $http_user_agent $limit_bots {
default '';
~*(bing|yandex|msnbot) $binary_remote_addr;
}
limit_req_zone $limit_bots zone=bots:10m rate=1r/m;
server {

Keybase proof

I hereby claim:

  • I am arosenhagen on github.
  • I am aro (https://keybase.io/aro) on keybase.
  • I have a public key ASDvoh9uZE6d55TVvbBnVryerBlfkZVntZ7qR9F9v06WKgo

To claim this, I am signing this object:

Verifying that "arosenhagen.id" is my Blockstack ID. https://explorer.blockstack.org/name/arosenhagen.id
Verifying my Blockstack ID is secured with the address 1RhdHiBoKn7kVGrxhWqLJ1FChrv82XJJX https://explorer.blockstack.org/address/1RhdHiBoKn7kVGrxhWqLJ1FChrv82XJJX
@arosenhagen
arosenhagen / LocalAdapterFactory.patch
Created November 6, 2020 12:13
[PATCH] Shopware - Allow definition of strategy in media adapter (allow migrating back to plain strategy)
diff --git a/engine/Shopware/Bundle/MediaBundle/Adapters/LocalAdapterFactory.php b/engine/Shopware/Bundle/MediaBundle/Adapters/LocalAdapterFactory.php
index b7c02b3a28..f93b4eeab3 100644
--- a/engine/Shopware/Bundle/MediaBundle/Adapters/LocalAdapterFactory.php
+++ b/engine/Shopware/Bundle/MediaBundle/Adapters/LocalAdapterFactory.php
@@ -65,11 +65,12 @@ class LocalAdapterFactory implements AdapterFactoryInterface
$options = new OptionsResolver();
$options->setRequired(['root']);
- $options->setDefined(['file', 'dir', 'mediaUrl', 'type', 'permissions', 'url']);
+ $options->setDefined(['strategy', 'file', 'dir', 'mediaUrl', 'type', 'permissions', 'url']);
diff --git a/DependencyInjection/services.xml b/vendor/shopware/storefront/DependencyInjection/services.xml
index 63457b84..cbf8e564 100644
--- a/DependencyInjection/services.xml
+++ b/DependencyInjection/services.xml
@@ -23,11 +23,12 @@
<parameter>https</parameter>
<parameter>forwarded</parameter>
<parameter>host</parameter>
- <parameter>x_forwarded_for</parameter>
- <parameter>x_forwarded_host</parameter>
@arosenhagen
arosenhagen / BlogHelper.php.patch
Last active February 7, 2022 16:38
Switch Tag FIlter
diff --git a/src/Helper/BlogHelper.php b/src/Helper/BlogHelper.php
index c56675af..aa7424e5 100644
--- a/src/Helper/BlogHelper.php
+++ b/src/Helper/BlogHelper.php
@@ -46,13 +46,12 @@ class BlogHelper
if($rssCategoryOnly) {
$criteria->addFilter(new EqualsFilter('category.includeinrss', true));
-
+ }