Skip to content

Instantly share code, notes, and snippets.

View Tuurlijk's full-sized avatar
🏠
Working from home

Michiel Roos Tuurlijk

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tuurlijk on github.
  • I am tuurlijk (https://keybase.io/tuurlijk) on keybase.
  • I have a public key ASBSWukQjv68Unm_jrPIAQc4F1eytqzkRnrFLz-jREbOwgo

To claim this, I am signing this object:

@Tuurlijk
Tuurlijk / Deprecation-legacy-files.md
Created September 12, 2018 06:15
Details on deprecated legacy for a TYPO3 deprecation scanner

Renamed TYPO3 core libraries

Description

The classes t3lib_* and tslib_* have been removed from the core. You could use them when you had the compatibility layer enabled.

Impact

All code calling methods like t3lib_div::makeInstance() will no longer work.

Migration

Use the current replacements in the core like GeneralUtility::makeInstance().

@Tuurlijk
Tuurlijk / Deprecation-non-namespaced.md
Created September 12, 2018 06:19
Details on deprecated legacy for a TYPO3 deprecation scanner

Use of non-namespaced classes

Description

In the past extensions used classnames starting with tx_. Since the intruduction of namespaces in TYPO3, you should use namespaces instead.

Impact

If you prefix your old classnames with \ throughout your code, things may still work.

Migration

Use proper namespaced code instead.

<?php
$basePath = '/home/Blah/tmp/TYPO3.CMS/typo3/sysext/core/Documentation/Changelog';
$dir = new DirectoryIterator($basePath);
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
$filename = $fileinfo->getFilename();
if (strpos($filename, '.htaccess') === 0 || strpos($filename, 'Howto') === 0) {
@Tuurlijk
Tuurlijk / DataHandler.php
Created January 21, 2022 15:36
Populate l10n_state field of tt_content records when creating a translation. So the radio buttons for allowLanguageSynchronization are set to 'custom value' by default.
<?php
namespace Some\Client\Hooks;
/**
* DataHandler
*
* Contains hooks for the \TYPO3\CMS\Core\DataHandling\DataHandler class
*/
class DataHandler
@Tuurlijk
Tuurlijk / Readme.md
Last active February 12, 2022 13:21
Kitty theme switching based on the time of day

Kitty theme switching based on the time of day

I realy like the PHPStorm extension ChronoMorph which switches between light and dark themes depending on the time of day.

I wanted that for my terminal too. And since the kitty terminal can be remote controlled, we can implement this with two simple scripts.

One script fetches the sunrise and sunset times. It can run once a day.

The other one checks the current time against the sunrise and sunset times and determines if a light or dark mode should be used. It can run every five minutes or however often you like.

@Tuurlijk
Tuurlijk / enable-xdebug.sh
Created April 11, 2016 18:51
phpbrew 5.5.32 xdebug installation
#!/bin/bash
#
# We need to re-build the php version because we removed it when compressing the box.
#
# In a newer version . . . I can pre-build the xdebug module when building the box, but 'disable' it by default.
# This can also be done for other common modules.
source /etc/profile.d/phpbrew.sh
phpbrew use php-5.5.32
@Tuurlijk
Tuurlijk / OrphanRecordsCommand.php
Created January 10, 2024 13:27
An optimized version of the orphan records command
<?php
declare(strict_types=1);
namespace TYPO3\CMS\Lowlevel\Command;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2