Skip to content

Instantly share code, notes, and snippets.

View oliverthiele's full-sized avatar

Oliver Thiele oliverthiele

View GitHub Profile
@oliverthiele
oliverthiele / FluidLayout.html
Created March 12, 2017 16:07
Some of my favorite Live-Templates for PhpStorm
{namespace b=OliverThiele\OtBootstrap3\ViewHelpers}
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:spaceless>
$END$
<f:render section="Content" />
</f:spaceless>
</html>
@oliverthiele
oliverthiele / ModelController.php
Created July 22, 2014 20:33
Debugging errors like "An error occurred while trying to call Vendor\ExtKey\Controller\ModelController->showAction() " in extbase extensions
/**
* A special action which is called if the originally intended action could
* not be called, for example if the arguments were not valid.
*
* The default implementation sets a flash message, request errors and forwards back
* to the originating action. This is suitable for most actions dealing with form input.
*
* We clear the page cache by default on an error as well, as we need to make sure the
* data is re-evaluated when the user changes something.
*
@oliverthiele
oliverthiele / InstallTypo3.sh
Last active July 23, 2023 16:17
Script for installing TYPO3 with v12.4 (or v11.5) LTS on a clean Ubuntu 22.04 root server.
#!/bin/bash
### Before executing this script make a system update:
# $> apt update; apt --assume-yes dist-upgrade; apt --assume-yes autoremove;
# $> reboot
# VirtualBox does not work with ipv6, so you have to disable it before running this script:
# $> sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
@oliverthiele
oliverthiele / webpack.config.js
Created November 6, 2023 08:57
My webpack config for TYPO3 v11 and v12. Works with public/_asset/[hash] symlinks in TYPO3 v12
'use strict'
// Imports
const {VueLoaderPlugin} = require("vue-loader");
const fs = require('fs');
const path = require('path');
const autoprefixer = require('autoprefixer');
const CopyWebpackPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
@oliverthiele
oliverthiele / LocalStorageSVGs.js
Last active November 6, 2023 09:00
This JavaScript allows multiple icons stored in a sprite file to be used in the web page via LocalStorage. On the first call or when the file revision is changed, the file is downloaded from the server and stored in LocalStorage. So that the DOM is not unnecessarily extended with too many icons, a check is first made to see which icons are prese…
/**
* Version 3.0.0
*
* process.env constants are set via webpack (https://gist.github.com/oliverthiele/6298902d5192aa86f24682a3afbd0d9f)
*/
const assetsUrl = process.env.TYPO3_ASSETS_URL;
const revision = process.env.SVG_REVISION;
export function localStorageSVGs() {
@oliverthiele
oliverthiele / robots.txt
Last active November 23, 2023 18:18
robots.txt for TYPO3
User-agent: *
# Only allow URLs generated with RealURL
Disallow: /*?id=*
Disallow: /*&id=*
# L=0 is the default language
Disallow: /*?L=0*
Disallow: /*&L=0*