Skip to content

Instantly share code, notes, and snippets.

@emtii
emtii / spryker-local-development
Created June 25, 2018 07:57
Spryker - Setup local development environment (with spryker-shop/suite and devvm v2.0.0)
**Setup**
1. cd into your ~/Workspace
2. git clone git@github.com:spryker/devvm.git spryker-devvm-suite
3. cd ./spryker-devvm-suite && git checkout tags/2.0.0
4. VM_PROJECT=suite SPRYKER_REPOSITORY="git@github.com:spryker-shop/suite.git" vagrant up
6. ./project on host machine contains suite files now, mounted to /data/shop/development/current in vagrant box
7. vagrant ssh
8. composer global require hirak/prestissimo
9. ulimit -n 65535
@emtii
emtii / delete_orders_sw510.txt
Created May 24, 2017 13:47
delete orders from sw5.1.0 instance
1. truncate
====================================================================================================================
SET foreign_key_checks = 0;
TRUNCATE `s_order`;
TRUNCATE `s_order_attributes`;
TRUNCATE `s_order_basket`;
TRUNCATE `s_order_basket_attributes`;
TRUNCATE `s_order_basket_saved`;
TRUNCATE `s_order_basket_saved_items`;
TRUNCATE `s_order_billingaddress`;
@emtii
emtii / delete_customers_sw510.txt
Last active May 24, 2017 13:45
delete customers from sw5.1.0 instance
1. truncate
====================================================================================================================
SET foreign_key_checks = 0;
TRUNCATE `s_user`;
TRUNCATE `s_user_attributes`;
TRUNCATE `s_user_billingaddress`;
TRUNCATE `s_user_billingaddress_attributes`;
TRUNCATE `s_user_debit`;
TRUNCATE `s_user_shippingaddress`;
TRUNCATE `s_user_shippingaddress_attributes`;
@emtii
emtii / howto.txt
Last active March 7, 2017 10:03
Simple HTTP transaction timing breakdown with cURL
1. create file "requestpattern.txt" with the following content:
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
@emtii
emtii / delete_instance_sw528.txt
Last active January 27, 2017 14:00
Deletes Articles from Shopware 5.2.8
Description
====================================================================================================================
We basically need 2 steps to completely remove articles, categories & suppliers from this shopware version:
1. truncate mysql tables
2. use sw cli command to remove left images from filesystem
1. truncate
====================================================================================================================
SET foreign_key_checks = 0;
@emtii
emtii / sw5_create_backend_user.sh
Last active January 14, 2017 22:14
Creates backend user of given strings (=usernames) in array in Shopware 5 Apps.
#!/bin/bash
# user to create
ARRAY=(
"emtii"
)
# iterate users
for (( i = 0; i < ${#ARRAY[@]}; ++i )); do
@emtii
emtii / sw5_config_production_cdn.php
Created December 6, 2016 21:28
example production + cdn config for shopware 5 Raw
<?php
return [
// database settings
'db' => [
'host' => 'localhost',
'port' => '3306',
'username' => 'shopware',
'password' => 'shopware',
'dbname' => 'shopware'
@emtii
emtii / sw5.htaccess
Created December 1, 2016 10:50
Shopware 5 mod_expires & mod_filter
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE "application/atom+xml" \
"application/javascript" \
"application/json" \
"application/ld+json" \
"application/manifest+json" \
"application/rdf+xml" \
"application/rss+xml" \
"application/schema+json" \
"application/vnd.geo+json" \
@emtii
emtii / tmp.txt
Created November 21, 2016 21:39
Frontend Performance Optimization and Testing
Why do I need frontend testing?
There are untold number of subtle
errors that can occur on the frontend.
Minor CSS changes that throw things off
Changes to JS files that break things
Aggregates changing when not necessary
Performance regressions
@emtii
emtii / getGitAllUserStats.sh
Created November 21, 2016 21:34
Get User Stats of all GIT Users.
#!/bin/bash
git log --shortstat --pretty="%cE" | sed 's/\(.*\)@.*/\1/' | grep -v "^$" | awk 'BEGIN { line=""; } !/^ / { if (line=="" || !match(line, $0)) {line = $0 "," line }} /^ / { print line " # " $0; line=""}' | sort | sed -E 's/# //;s/ files? changed,//;s/([0-9]+) ([0-9]+ deletion)/\1 0 insertions\(+\), \2/;s/\(\+\)$/\(\+\), 0 deletions\(-\)/;s/insertions?\(\+\), //;s/ deletions?\(-\)//' | awk 'BEGIN {name=""; files=0; insertions=0; deletions=0;} {if ($1 != name && name != "") { print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net"; files=0; insertions=0; deletions=0; name=$1; } name=$1; files+=$2; insertions+=$3; deletions+=$4} END {print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net";}'