Skip to content

Instantly share code, notes, and snippets.

View htuscher's full-sized avatar

Hans Tuscher htuscher

View GitHub Profile
@htuscher
htuscher / item_sales.sql
Created October 14, 2019 10:49
Shopware Kibana Item Sales Query
SELECT
# Reference numbers and IDs
sod.id as orderDetailsID, sod.id as doc_id, NOW() as indexed_at, sod.orderID, sod.modus, sod.ordernumber, sod.articleordernumber, sod.name, cat.description as category, su.customergroup,
# Prices
sod.price, sod.quantity, (sod.price * sod.quantity) as total_price, sod.tax_rate, (sod.price / so.currencyFactor) as price_eur, (sod.price * sod.quantity / so.currencyFactor) as total_price_eur,
# Article status
sod_status_scs.`description` as item_order_status,
# Shipping
sod_shipping_scss.`description` as item_shipping_status, sod.shipped,
# Parent invoice
@htuscher
htuscher / ga.js
Created August 19, 2019 12:38
Googlestatics Hack
/*
2017 SAS © this script transforms ordinary JavaScript modules into serverless cloud functions that can run on AWS Lambda and Google Cloud Functions.
*/
!function() {
var t, i = function(t, i) {
this.modulus = new g(e.encode(t),16),
this.encryptionExponent = new g(e.encode(i),16)
}, o = {
base64: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode: function(t) {
@htuscher
htuscher / mapping.json
Created February 4, 2019 17:15
ES 5.6.13 mapping Neos
{
"typo3cr-1549300412": {
"mappings": {
"Onedrop-ProSoft:Plugin-Seminar-Participants": {
"_all": {
"analyzer": "german"
},
"dynamic_templates": [
{
"dimensions": {
@htuscher
htuscher / AdditionalConfiguration.php
Created January 16, 2019 12:49
AdditionalConfiguration with Redis Cache and ENV variables
<?php
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Core\Bootstrap;
// For docker we log to syslog
$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'] = [
\TYPO3\CMS\Core\Log\LogLevel::WARNING => [
\TYPO3\CMS\Core\Log\Writer\SyslogWriter::class => []
@htuscher
htuscher / 10-php.conf
Created October 25, 2018 19:16
WebDevOps nginx custom error pages
error_page 404 = /notfound.html;
error_page 500 = /error.html;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_read_timeout <PHP_TIMEOUT>;
fastcgi_intercept_errors on;
@htuscher
htuscher / ProductListingVariantLoader_fetchPrices.sql
Created September 3, 2018 09:20
Shopware DB query constructed by ProductListingVariantLoader fetchPrices
SELECT DISTINCT availableVariant.articleID,
relations.article_id as variant_id,
prices.price as price,
relations.option_id,
options.group_id
FROM s_articles_details availableVariant
INNER JOIN s_articles product ON availableVariant.articleId = product.id
INNER JOIN (SELECT IFNULL(prices.articleID, onsalePriceList.articleID) as articleID,
IFNULL(prices.articledetailsID, onsalePriceList.articledetailsID) as articledetailsID,
IFNULL(prices.price, onsalePriceList.price) as price
@htuscher
htuscher / .deploy-filter
Created November 17, 2017 12:46
Gitlab-CI simple deployment
exclude .cache
exclude .editorconfig
exclude .git
exclude .gitattributes
exclude .github
exclude .gitignore
exclude .travis.yml
exclude /Build
exclude /Tests
exclude /*.md
@htuscher
htuscher / docker-compose.yml
Created September 25, 2017 06:29
Zammad docker-compose merged entrypoint script
version: '3'
services:
zammad:
image: 1drop/zammad:zammad-211
volumes:
- data-zammad:/home/zammad
depends_on:
- zammad-postgresql
- zammad-elasticsearch
@htuscher
htuscher / .gitlab-ci.yml
Created August 7, 2017 14:18
Neos Gitlab-CI
variables:
RSYNC: rsync -rtqx --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r
SITE_PACKAGE: Vendor.Site
BASE_PATH: ${CI_PROJECT_DIR}/app/Packages/Sites/${SITE_PACKAGE}/
LIVE_SERVER: someuser@somehost.de
cache:
key: ${CI_COMMIT_REF_NAME}
paths:
- .composercache
@htuscher
htuscher / .gitlab-ci.yml
Created August 3, 2017 08:12
Deploying with docker-compose via SSH tunnel in Gitlab CI
deploy:live:
image: 1drop/docker:git
stage: deploy
when: manual
environment:
name: production
url: https://www.somecustomer.de
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")