Skip to content

Instantly share code, notes, and snippets.

View akiessling's full-sized avatar

Andreas Kießling akiessling

View GitHub Profile
@bmack
bmack / GenerateUrlWithSites.php
Created June 21, 2019 06:20
TYPO3: Create an absolute URL for a page with Site Handling
/**
* Generates an absolute URL for a page (based on Site Handling)
*
* @param int $pageId
* @param array|null $arguments
* @return UriInterface
* @throws \TYPO3\CMS\Core\Exception\SiteNotFoundException
* @throws \TYPO3\CMS\Core\Routing\InvalidRouteArgumentsException
*/
private function getUrlForPage(int $pageId, array $arguments = null): UriInterface
@einpraegsam
einpraegsam / RealurlDecoding.php
Created July 11, 2017 08:54
Individual URI-path with realurl in TYPO3. In the following example we need to have paths like /lastname.firstname for a detailview on contacts. And of course we don't want to have redirects. Thinking of a configuration in realurl that uses /folder1/folder2/Action/lastname.firstname that will be extended with the classes below.
<?php
namespace In2code\Extkey\Hooks;
/**
* Class RealurlDecoding
*/
class RealurlDecoding
{
/**
@kitze
kitze / store-wrapper.js
Last active April 28, 2022 13:45
mobx store wrapper for storybook
import React from 'react';
import {Provider} from 'mobx-react';
const stub = () => true;
export const exampleStore = {
app: {},
auth: {
checkAuth: stub
},
@foxxyz
foxxyz / nginx.conf
Last active March 3, 2024 10:42
Serve current directory via nginx
# Extremely basic development setup to serve the current directory at http://localhost:9001
# Start nginx in this directory with `nginx -p . -c nginx.conf`
# Stop nginx with `nginx -p . -s stop`
events {}
http {
# Serve files with correct mimetypes on OSX
# location may have to be adjusted depending on your OS and nginx install
include /usr/local/etc/nginx/mime.types;
@olmokramer
olmokramer / css-color-regex
Last active December 9, 2023 12:52
Regex for CSS colors: hex, rgb(a), hsl(a)
/(#([0-9a-f]{3}){1,2}|(rgba|hsla)\(\d{1,3}%?(,\s?\d{1,3}%?){2},\s?(1|0?\.\d+)\)|(rgb|hsl)\(\d{1,3}%?(,\s?\d{1,3}%?\)){2})/i
<?php
namespace Smichaelsen\Gist\Mail;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
/**
* This class represents an email which can be rendered with fluid.
* You can use all the possibilities of TYPO3's MailMessage but instead of
@mestizo
mestizo / gist:9167834
Last active July 22, 2024 20:34
Completely disable IPv6 on OSX
#To Get List of Hardware
sudo networksetup -listallhardwareports
#To Disable IPv6 on Wifi Adapter
sudo networksetup -setv6off wi-fi
#To Disable IPv6 on Built-in Ethernet Adapter
sudo networksetup -setv6off Ethernet
@InvisibleKind
InvisibleKind / DataHandlerHooks.php
Last active December 16, 2016 16:08
ExtBase localization of child records
<?php
namespace Vendor\Product\Hooks;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class DataHandlerHooks {
/**