Skip to content

Instantly share code, notes, and snippets.

View josefglatz's full-sized avatar
👨‍💻

Josef Glatz josefglatz

👨‍💻
View GitHub Profile
@josefglatz
josefglatz / gitlab-runner-toml-part.toml
Created March 21, 2023 07:33
Fix fckng gitlab runner stuff
pre_get_sources_script = "git config --global --add safe.directory '*'"
@josefglatz
josefglatz / dev.yaml
Created March 15, 2023 12:44
DDEV provider real worldexample for pulling from a remote environment
environment_variables:
REMOTE_HOST: customerwebsite-production-dev
REMOTE_DB: proddev_5Re2
REMOTE_EXTRA_FILE: "/var/www/html/shared/.my.cnf"
REMOTE_DATA_PATH: /var/www/html/shared/Data
REMOTE_IGNORE_TABLES: |-
"be_sessions
cache_treelist
fe_sessions
services:
solr:
container_name: ddev-${DDEV_SITENAME}-solr
image: "solr:8.11"
env_file: "../app/.env"
networks:
default: null
volumes:
@josefglatz
josefglatz / Synology Reverse Proxy for Redmine Custom Headers.md
Created October 11, 2021 06:28
Notes about running Redmine behind HTTPS Reverse Proxy on a Synology NAS
Header Name Value
X-Real-IP $remote_addr
X-Forwarded-For $proxy_add_x_forwarded_for
Host $http_host
X-Forward-Proto $scheme
@josefglatz
josefglatz / .htaccess
Last active March 31, 2021 11:20
TYPO3 10 LTS on organization/institute webspace on univie.ac.at hosting environment (2020-03)
# Adopt one line in the TYPO3 default .htaccess right in your document_root:
# delete `Options -MultiViews`
# see also https://github.com/TYPO3/TYPO3.CMS/blob/440f748a8d75be5a2be516f5c09b99c932942f2c/typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess#L356
@josefglatz
josefglatz / docker-compose_mysqldump-to-host.sh
Created October 8, 2020 18:25
Example of how to dump a database with a lowlevel approach requested by Alexander
docker-compose exec --user mysql mysql sh -c "mysqldump -udev -pdev typo3 2>/dev/null" > $(date +"%Y%m%d_%H%M%S").sql
@josefglatz
josefglatz / RemoveEmptyParagraphViewHelper.php
Last active September 11, 2020 04:26
ViewHelper for your sitepackage extension (e.g. ext:theme/Classes/ViewHelpers/Format/RemoveEmptyParagraphViewHelper.php)
<?php
declare(strict_types = 1);
namespace JosefGlatz\Theme\ViewHelpers\Format;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;
/**
* Remove empty P tags from $content by using preg_replace
#!/bin/bash
#
# at.supseven.jglatz.deleteapfssnapshots 1.0.0
#
# Deletes all APFS Snapshots.
# 2020 Josef Glatz
#
echo
echo "Local Snapshots:"
[BUGFIX] for Mittwald to support PHP 7.3 FPM
to prevent errors like >IDNA_CHECK_BIDI...<
the guzzle version is fixed to 6.5.4 instead
of version 6.5.5 with the command
composer req guzzlehttp/guzzle:6.5.4 --update-with-all-dependencies
Changelogs summary:
- symfony/polyfill-intl-normalizer removed (installed version was v1.18.0)
@josefglatz
josefglatz / PHP strtotime relative cheatsheet.md
Last active June 29, 2020 05:23
I use that mainly for TYPO3 extension georgringer/news Time Restriction fields and TypoScript configuration

PHP strtotime relative cheatsheet

Example for ext:news timeRestrictionHigh archive Page: show only news older than 3 years relative to last day of year

To get always the 31 december 3 years ago (actual 8.7.2020, you want 31.12.2017)

-3 years 31 december