Skip to content

Instantly share code, notes, and snippets.

View peterjaap's full-sized avatar

Peter Jaap Blaakmeer peterjaap

  • elgentos ecommerce solutions / Blaakmeer Webdevelopment
  • Groningen, the Netherlands
View GitHub Profile
@erikhansen
erikhansen / 1_product_queries.sql
Last active April 2, 2024 01:48
Magento 2 - Remove duplicate store view-specific product and category data
/*
* IMPORTANT: The queries below are written for Magento Enterprise. If you're going to run them on Magento Community, you need
* to replace all instances of ".row_id" with ".entity_id". See this for context: http://magento.stackexchange.com/questions/139740/magento-2-schema-changes-for-ee-catalog-staging
*
* When importing products in Magento 2, if you specify store view codes in the store_view_code column, product data will be set at
* both the global scope as well as the specific store view scope. This is not ideal because now you have duplicate
* data at two different scopes that shouldn't actually be duplicated. The scripts below clean up this data by finding
* data set at specific store view scopes and if it's an exact match to the data set at the global store view, then it
* deletes the data set at the specific store view scope.
*
@gititGoro
gititGoro / Recipe.md
Last active September 15, 2023 07:32
Environmental setup for Ethereum Dev as of 14 June 2017

Setting up a private ethereum blockchain for development and pointing your wallet at it

Ethereum tutorials all advise downloading the Mist wallet and beginning dev. The only problem is that the testnet and real blockchain are huge and take hours to download. What follows is a recipe for quickly setting up a small blockchain and pre-mining it with some test ethereum

The following is done in Linux but will work in MacOS and should have equivalent command line options in Windows. Where I don't give detailed instructions, it's because a quick google search will fill in the blanks.

Install geth https://github.com/ethereum/go-ethereum/wiki/geth

install Mist https://github.com/ethereum/mist/releases

@edannenberg
edannenberg / magento_url_rewrite.patch
Last active August 11, 2022 17:27
Fixes the catalog url rewrite indexer in Magento 1.7.x-1.9.x See https://github.com/magento/bugathon_march_2013/issues/265 for details.Update: DexterDee in the ticket above noted that the previous patch had some side effects. This updated patch still feels like duct tape but at least it seems to be free of the mentioned side effects. It also fix…
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url
$this->_rewrite = $rewrite;
return $requestPath;
}
+
+ // avoid unnecessary creation of new url_keys for duplicate url keys
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix)));
@IvanChepurnyi
IvanChepurnyi / Table.php
Last active July 11, 2022 10:44
Optimized options load
<?php
/**
* Optimized version of attribute source options model
*
* That allows to preload options once and reuse them instead of doing calls to db all the time
*
*/
class EcomDev_Optimization_Model_Resource_Attribute_Source_Table
extends Mage_Eav_Model_Entity_Attribute_Source_Table
@peterjaap
peterjaap / varnishlog-examples.sh
Created June 24, 2020 09:40 — forked from cupracer/varnishlog-examples.sh
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header
@erfanimani
erfanimani / prepare-magento-deployment
Last active June 5, 2016 08:53
Prepare Magento deployment hook for Envoyer.io (Install Composer Dependencies - After)
cd {{project}}
mkdir -p storage/media
mkdir -p storage/var
chmod -fR g+w storage || true
cp -rTv {{release}}/docroot/media/ storage/media/
cp -rTv {{release}}/docroot/var/ storage/var/
rm -r {{release}}/docroot/media