Skip to content

Instantly share code, notes, and snippets.

View xperseguers's full-sized avatar

Xavier Perseguers xperseguers

View GitHub Profile
<?php
declare(strict_types=1);
namespace MyVendor\MyExt\ViewHelpers;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
@einpraegsam
einpraegsam / StringUtility.php
Created July 20, 2017 09:05
Get youtube code from any URI
<?php
namespace In2code\In2template\Migration\Utility;
/**
* Class StringUtility
*/
class StringUtility
{
/**
@smichaelsen
smichaelsen / DateInterval.php
Last active November 26, 2015 09:19
Example how to use the TypeInterface to let extbase initialize objects from your database records
<?php
namespace AppZap\MyExt\Type;
use TYPO3\CMS\Core\Type\TypeInterface;
/**
* In our application we have fields that store time intervals as minutes in the database.
* In our code we want proper DateInterval objects, so we use a TypeInterface to let extbase take care of the conversion.
*
* Usage example on a model property:
@smichaelsen
smichaelsen / Favicons.html
Last active October 12, 2023 17:52
Multiple Favicons in TypoScript
<html data-namespace-typo3-fluid="true" xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers">
<link rel="apple-touch-icon" sizes="57x57" href="{f:uri.resource(path:'Favicons/apple-touch-icon-57x57.png')}">
<link rel="apple-touch-icon" sizes="60x60" href="{f:uri.resource(path:'Favicons/apple-touch-icon-60x60.png')}">
<link rel="apple-touch-icon" sizes="72x72" href="{f:uri.resource(path:'Favicons/apple-touch-icon-72x72.png')}">
<link rel="apple-touch-icon" sizes="76x76" href="{f:uri.resource(path:'Favicons/apple-touch-icon-76x76.png')}">
<link rel="apple-touch-icon" sizes="114x114" href="{f:uri.resource(path:'Favicons/apple-touch-icon-114x114.png')}">
<link rel="apple-touch-icon" sizes="120x120" href="{f:uri.resource(path:'Favicons/apple-touch-icon-120x120.png')}">
<link rel="apple-touch-icon" sizes="144x144" href="{f:uri.resource(path:'Favicons/apple-touch-icon-144x144.png')}">
<link rel="apple-touch-icon" sizes="152x152" href="{f:uri.resource(path:'Favicons/apple-touch-icon-152x152.png')}">
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@pgampe
pgampe / .gource
Created August 9, 2013 19:52
Render videos of a git repository. This is my config for TYPO3 CMS 4.6. The perl script for fetching the avatar images might be broken. It is not really needed. And it does store all images as PNG files, but some of them are JPEGs...
[display]
#fullscreen=true
#viewport=1680x1050
viewport=1280x720
[gource]
camera-mode=overview
colour-images=true
file-idle-time=5
hide=filenames,dirnames,mouse,progress,date
@fsuter
fsuter / gist:5803411
Last active November 22, 2022 10:18
The code samples below demonstrate how to register a custom soft reference parser for TYPO3 CMS. This consists of 3 steps: 1) register the soft reference parser key globally 2) add the soft reference parser key to the appropriate fields in the TCA 3) code the soft reference parser The example is taken from extension "templatedisplay".
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser'][$_EXTKEY] = 'Tesseract\Templatedisplay\Service\SoftReferenceParser';
@kroger
kroger / layout.html
Created July 31, 2012 01:21
Layout for epub style for Sphinx
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}"/>
{{ metatags }}
{%- block htmltitle %}
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.