Skip to content

Instantly share code, notes, and snippets.

View froemken's full-sized avatar

Stefan Frömken froemken

View GitHub Profile
@froemken
froemken / powermail_newsletter.typoscript
Last active August 18, 2023 09:34
Newsletter subscription and unsubscribe TypoScript for extension powermail, based on TYPO3
# PART 1 FOR SUBSCRIBE
# AT THE END OF THIS FILE YOU WILL FIND PART 2 FOR UNSUBSCRIBE,
# WHICH HAS TO BE ADDED ON A DIFFERENT PAGE
plugin.tx_powermail.settings.setup {
# Mail log persistence must be active because of double opt-in
db.enable = 1
dbEntry.1 {
@froemken
froemken / QueryResultHelper.php
Created June 6, 2023 06:42
Use correct COUNT on queries build with TYPO3 QueryBuilder. Solve queries containing JOIN. Tag: ONLY_FULL_GROUP_BY
<?php
declare(strict_types=1);
/*
* This file is part of the package jweiland/yellowpages2.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
@froemken
froemken / CkEditor5.yaml
Created May 9, 2023 06:14
Simple CKEditor YAML configuration for TYPO3 12
# Add Froemmi specified configuration
# For complete documentation see https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html
editor:
#externalPlugins:
# typo3link: { route: 'rteckeditor_wizard_browse_links' }
config:
# the CSS file to be used inside the editor
contentsCss:
- "EXT:site_package/Resources/Public/Css/RTE.css"
@froemken
froemken / ddev-output-ssl-problem-4427.log
Created December 4, 2022 13:12
DDEV Debug Output: curl request results in: LibreSSL SSL_connect: SSL_ERROR_SYSCALL #4427
➜ typo3_git curl -vvv -X 'POST' 'https://typo3git.ddev.site'
* Trying ::1:443...
* connect to ::1 port 443 failed: Connection refused
* Trying 127.0.0.1:443...
* Connected to typo3git.ddev.site (127.0.0.1) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
* CAfile: /etc/ssl/cert.pem
* CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
@froemken
froemken / ShowDBSize.sql
Created August 3, 2021 09:23
SQL Query to get size in MB for data and index of given database name
SELECT table_name AS "Table", ROUND((data_length / 1024 / 1024), 2) AS "Data size (MB)", ROUND((index_length / 1024 / 1024), 2) AS "Index size (MB)"
FROM information_schema.TABLES
WHERE table_schema = "[database_name]"
ORDER BY data_length DESC
@froemken
froemken / UnbindLeafletPopup.js
Created May 5, 2021 15:02
Remove on click event after applying popup with bindPopup in Leaflet
// Example for TYPO3 extension maps2
$maps2OpenStreetMaps[0].map.eachLayer(function(layer) {
if (layer instanceof L.Polygon){
layer.off("click");
}
});
@froemken
froemken / testEmailServer.php
Last active January 8, 2024 01:20
Very simple PHP Script to test SMTP email server
<?php
// For port 24 host without scheme is just fine
// Add scheme, if using secure connection. Port 465 or 587
$host = 'ssl://smtp.strato.de';
//$host = 'tls://smtp.strato.de';
$port = 465;
//$port = 25;
$errorNumber;
$error;
$timeout = 10;
@froemken
froemken / git-zsh.sh
Created April 9, 2021 08:12
Deactivate git dirty check on ZSH because of performance reasons
# Switching directories can be very slow in ZSH with activated git dirty check.
# Some themes create their own git queries and sometimes ignore these flags.
# @link: https://stackoverflow.com/questions/12765344/oh-my-zsh-slow-but-only-for-certain-git-repo
# It does not work with spaceship theme.
git config --global --add oh-my-zsh.hide-status 1
git config --global --add oh-my-zsh.hide-dirty 1
@froemken
froemken / CopyPageTreeHook.php
Created January 28, 2021 16:21
A really nasty solution to prevent call of TYPO3 Solr getAvailableSites performance issue
/**
* While copying pagetree we have to prevent calling getAvailableSites of solr, as it
* initializes ALL 300 pagetrees and load its full TS.
*/
protected function modifyRequestForSolrAndSolrfal()
{
// While copying pagetree solr will monitor various records. But without known
// rootPageUid it will call getAllSites() which will build the TS for all sites.
// We set monitored tables to invalidTable, so NO table will be monitored.
$solrExtConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['solr']);
@froemken
froemken / PersistedUidMapper.php
Last active October 15, 2020 06:55
Extended version of PersistedPatternMapper of TYPO3 to convert german umlauts
<?php
declare(strict_types=1);
/*
* This file is part of the package jweiland/events2.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/