Skip to content

Instantly share code, notes, and snippets.

View helhum's full-sized avatar
💭
I may be slow to respond.

Helmut Hummel helhum

💭
I may be slow to respond.
View GitHub Profile
@helhum
helhum / ANewsImageVariantExample.php
Last active May 26, 2024 21:55
Responsive image backend definition and frontend rendering with helhum/typo3-top-image
<?php
declare(strict_types=1);
namespace Dkn\SitePackage\Configuration\ImageVariants;
use Helhum\TopImage\Definition;
use Helhum\TopImage\TCA\ImageVariantConfigurationInterface;
class ANewsImageVariantExample implements ImageVariantConfigurationInterface
{
@helhum
helhum / Configuration-TCA-Overrides-tt_content.php
Created August 18, 2023 13:08
Add Topwire fields to tt_content elements
<?php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
(static function (): void {
$columns = [
'tx_turbo_wrap_in_frame' => [
'label' => 'Wrap in Turbo frame',
@helhum
helhum / CacheWarmingFrontend.php
Created March 22, 2019 15:01
TYPO3 Cache Warming
<?php
declare(strict_types=1);
namespace Helhum\SitePackage\Cache\Frontend;
use TYPO3\CMS\Core\Cache\Backend\BackendInterface;
use TYPO3\CMS\Core\Cache\Frontend\VariableFrontend;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Http\ServerRequestFactory;
class CacheWarmingFrontend extends VariableFrontend
@helhum
helhum / bench.php
Created September 13, 2018 23:09
Require vs. unserialize PHP Benchmarks
<?php
$data = array(
'AddThis_SharingTool_Block_Share' => 'app/code/community/AddThis/SharingTool/Block/Share.php',
'AddThis_SharingTool_Model_Observer' => 'app/code/community/AddThis/SharingTool/Model/Observer.php',
'Amasty_Base_Model_Feed' => 'app/code/local/Amasty/Base/Model/Feed.php',
'Amasty_Promo_Helper_Data' => 'app/code/local/Amasty/Promo/Helper/Data.php',
'Amasty_Promo_Model_Observer' => 'app/code/local/Amasty/Promo/Model/Observer.php',
'Amasty_Rules_Block_Adminhtml_Promo_Quote_Edit' => 'app/code/local/Amasty/Rules/Block/Adminhtml/Promo/Quote/Edit.php',
'Amasty_Rules_Block_Checkout_Discount' => 'app/code/local/Amasty/Rules/Block/Checkout/Discount.php',
@helhum
helhum / composer.json
Last active February 12, 2024 10:54
The (currently) ideal TYPO3 composer setup
{
"require": {
"typo3-console/composer-auto-setup": "^0.1",
"georgringer/news": "^6.1",
"helhum/typo3-secure-web": "^0.2.5",
"typo3/cms-introduction": "^3.0"
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
@helhum
helhum / setup.sh
Created October 29, 2017 14:08 — forked from sascha-egerer/setup.sh
Install script for my personal tool chain (Mac OS)
#!/bin/bash
set -e
# insert a line to a file if the line does not already exist
# - first parameter is the file to insert the line
# - second parameter is the line to insert. It'll only be inserted if not already exists
# - third parameter is optional. This will override the search behavior.
# Instead of searching for the line of parameter 2 this term is used.
function insertLineIfNotExists {
FILE=$1
@helhum
helhum / composer.json
Last active August 15, 2017 16:46
Fix environment variables with `REDIRECT_` prefix
{
"autoload": {
"files": ["res/fix-env.php"]
}
}
@helhum
helhum / composer.json
Last active January 28, 2022 09:49
TYPO3 Extension composer.json essentials
{
"name": "vendor/ext-key",
"description": "Essential composer.json attributes",
"keywords": ["typo3", "extension", "composer.json"],
"homepage": "http://helhum.io",
"authors": [
{
"name": "Helmut Hummel",
"email": "info@helhum.io"
}
@helhum
helhum / FluidTemplate.html
Last active April 27, 2021 20:29
Focus area View Helper
<a href="#"
class="lazyload fullscreen random-gallery"
id="js-random-image"
data-random-images="{h:homePageTeaserImages(
images: object.images,
breakPointConfiguration: {
300: '{maxWidth: \'300\', maxHeight: \'300\'}',
1000: '{maxWidth: \'1000\', maxHeight: \'1000\'}',
1900: '{maxWidth: \'1900\', maxHeight: \'1900\'}'}
) -> f:format.htmlspecialchars()}"
@helhum
helhum / deploy-to-target-info.md
Last active August 23, 2018 13:30
TYPO3 setup steps

Requirements for deployment

  • ssh (generate key and put on server)
  • rsync must be available on both machines (deployment host and target host)
  • PHP cli binary must be available on both machines (deployment host and target host)
  • composer must be available on deployment host

Needed info for each target system:

  • deploy directory