Skip to content

Instantly share code, notes, and snippets.

View smichaelsen's full-sized avatar
🥋
Changing the world in code

Sebastian Michaelsen smichaelsen

🥋
Changing the world in code
View GitHub Profile
OS Information: Darwin Sebastians-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
DDEV-Local version v1.17.1
architecture amd64
db drud/ddev-dbserver-mariadb-10.3:v1.17.0
dba phpmyadmin:5
ddev-ssh-agent drud/ddev-ssh-agent:v1.17.0
docker 20.10.5
docker-compose 1.29.0
os darwin
router drud/ddev-router:v1.17.0
test
@smichaelsen
smichaelsen / temporary_performance_patch.php
Created December 9, 2020 14:22
Put this in your sitepackage Configuration/TCA/Overrides/
<?php
// this mitigates the core bug #92863 and is taken from https://github.com/TYPO3/TYPO3.CMS/commit/db0d7549647ed5326f4affc84b907dd0e397c844
// this file can be removed entirely after updating to TYPO3 10.4.11
$GLOBALS['TCA']['sys_file_metadata']['columns']['l10n_parent']['config'] = [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'sys_file_metadata',
'size' => 1,
===================================================================
--- public/typo3conf/ext/news/Classes/Service/SlugService.php
+++ public/typo3conf/ext/news/Classes/Service/SlugService.php
@@ -221,60 +221,50 @@
$queryBuilder = $connection->createQueryBuilder();
// Get entries to update
+ $execTimeParameter = $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT);
+ $emptyStringParameter = $queryBuilder->createNamedParameter('', \PDO::PARAM_STR);
$statement = $queryBuilder
--- a/typo3/sysext/backend/Classes/Utility/BackendUtility.php
+++ b/typo3/sysext/backend/Classes/Utility/BackendUtility.php
@@ -2989,6 +2989,31 @@
}
/**
+ * Creates a link to create a record translation on demand and directly edit it
+ *
+ * @param string $table
+ * @param int $defaultLanguageRecordUid
@smichaelsen
smichaelsen / console.js
Created August 7, 2020 11:29
F1TV Cinema Mode
document.querySelector('#desktop-navigation-header').remove();
document.querySelector('.wXPTD').style.paddingTop = '0';
document.querySelector('._28ubt').style.gridTemplateColumns = 'auto 0';
document.querySelector('._28ubt').style.gridTemplateRows = 'auto 0';
document.querySelector('._28ubt').style.height = '100vh';
@smichaelsen
smichaelsen / classList.bem.js
Last active April 16, 2022 15:20
Add/Remove BEM Modifier with classList
DOMTokenList.prototype.getFullModifierClassName = function (modifier) {
if (this.length === 0) {
return '';
}
return this.item(0) + '--' + modifier;
};
DOMTokenList.prototype.addModifier = function (modifier) {
this.add(this.getFullModifierClassName(modifier));
};
@smichaelsen
smichaelsen / CategoryUtility.php
Created April 29, 2019 16:06
Files with code examples of ~mixed~ quality
<?php
namespace MyVendor\MyExtension\Utility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
/**
* Class MediaWallUtility
*
* @package MyVendor\MyExtension\Utility
@smichaelsen
smichaelsen / l10n_ws_fields.md
Created August 9, 2018 14:13
Localization and workspace related TYPO3 database fields

Localization and Workspaces SQL fields Cheat Sheet

Localization

sys_language_uid

Contains a uid pointing to the sys_language table and indicates which language the record is in. 0 means default language. -1 means this record should be used for all languages.

l10n_parent

#!/bin/bash
# Creator: Phil Cook
# Email: phil@phil-cook.com
# Twitter: @p_cook
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.6","7.0","7.1","7.2")
php_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
valet_support_php_version_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
php_installed_array=()