Skip to content

Instantly share code, notes, and snippets.

View kitzberger's full-sized avatar

Philipp Kitzberger kitzberger

View GitHub Profile
@fedetibaldo
fedetibaldo / any.php
Created September 18, 2020 08:38
Get Current Language ISO Code in TYPO3
<?php
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Utility\GeneralUtility;
// ...
$context = GeneralUtility::makeInstance(Context::class);
/** @var TYPO3\CMS\Core\Site\Entity\Site */
@kitzberger
kitzberger / .bashrc
Created May 13, 2019 07:50
git prompt
# Load one of these files
source /usr/lib/git-core/git-sh-prompt
source /usr/share/git-core/contrib/completion/git-prompt.sh
source /usr/local/git/contrib/completion/git-prompt.sh
source /etc/bash_completion.d/git
# Set flags
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
@einpraegsam
einpraegsam / datamappingExtbase.php
Last active November 3, 2023 16:15
Use DataMapper class in TYPO3 to convert an array into an object
public function mapProperties(): AnyModel
{
$properties = [
'uid' => 123,
'pid' => 123,
'firstname' => 'Alex',
'lastname' => 'Kellner'
'email' => 'my@email.org'
];
$dataMapper = $this->objectManager->get(TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::class);
@smichaelsen
smichaelsen / QueryResult.php
Created November 12, 2015 08:19
Extend extbase QueryResult to fix count() of queries with a custom $statement
<?php
namespace AppZap\Tripshop\Persistence;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement;
class QueryResult extends \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult
{
/**
* Overwrites the original implementation of Extbase
*
@htuscher
htuscher / Standard.html
Created February 27, 2015 13:08
FluidTYPO3 content_fallback
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
f:schemaLocation="https://fluidtypo3.org/schemas/fluid-master.xsd"
xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers"
flux:schemaLocation="https://fluidtypo3.org/schemas/flux-master.xsd"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
v:schemaLocation="https://fluidtypo3.org/schemas/vhs-master.xsd">
<f:layout name="Page" />
<f:section name="Configuration">
@helhum
helhum / PersistentObjectConverter.php
Last active January 24, 2021 14:08
Extbase TypeConverter to fetch hidden records from persistence (Using this will *always* fetch hidden models of the specified type)
<?php
namespace MyVendor\MyExtension\Property\TypeConverters
use TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter
class MyPersistentObjectConverter extends PersistentObjectConverter {
/**
* @var string
*/
@Alex1Git
Alex1Git / sunrise sunset calculation
Last active December 20, 2018 09:00
sunrise sunset calculation / Berechnung Sonnenaufgang und Sonnenuntergang
# Formel von Dr. Roland Brodbeck, Calsky
# http://lexikon.astronomie.info/zeitgleichung/neu.html
# Uebertragung auf Python 3 von Alexander Klupp 2014-01-14
import math
pi2 = 2*math.pi
pi = math.pi
RAD = math.pi/180