Skip to content

Instantly share code, notes, and snippets.

View soee's full-sized avatar
🏠
Working from home

Marcin Sągol soee

🏠
Working from home
View GitHub Profile
@rvollebregt
rvollebregt / debug-sql
Last active September 8, 2021 14:34
Debug SQL query in TYPO3 8 Extbase
/** @var ObjectManager $objm */
$dbParser = $this->objectManager->get(Typo3DbQueryParser::class);
$sql = $dbParser->convertQueryToDoctrineQueryBuilder($query)->getSQL();
DebuggerUtility::var_dump($sql);
@cedricziel
cedricziel / CustomerAutocompletion.php
Created November 4, 2016 14:40
TYPO3 CMS 7 fully loaded TSFE in EiD
<?php
namespace Project\Namespace\Hooks;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
@jrenggli
jrenggli / AdditionalConfiguration.php
Created December 16, 2015 21:26
pageNotFound_handling for restricted pages in TYPO3
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = 'USER_FUNCTION:EXT:usermytemplate/Classes/Utility/PageNotFoundHandling.php:user_pageNotFound->pageNotFound';
// Custom configuration for multi-language 404 page, see EXT:usermytemplate/Classes/Utility/PageNotFoundHandling.php
// ID of the page to redirect to if page was not found
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling_redirectPageID'] = 123;
// ID of the page to redirect to if current page is access protected
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling_loginPageID'] = 789;
@infusion
infusion / import-tar-gz.sh
Last active May 4, 2023 06:00
Import a tar.gz file to MySQL
tar xOf dump.sql.tar.gz | mysql -u $user -p $database
@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
*/
@visay
visay / PdfThumbnailViewHelper.php
Last active August 29, 2015 14:10
Render thumbnail from PDF file for a node type
<?php
namespace WE\SitePackage\ViewHelpers;
/* *
* This script belongs to the TYPO3 Flow package "WE.SitePackage". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title>Directives</title>
</head>
<body>
<div ng-controller="ChildController as child">
<button type="button" ng-click="child.sayMe()">Say me!</button>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.1/angular.min.js"></script>
@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active December 1, 2023 04:55
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@aertmann
aertmann / Method1.html
Last active September 7, 2018 21:21
Inline editable properties for a document node (two different approaches) – TYPO3 Neos
<neos:contentElement.wrap node="{node}">
<header>
<neos:contentElement.editable property="title" tag="h1" />
</header>
</neos:contentElement.wrap>
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace media=TYPO3\Media\ViewHelpers}
<div class="article-list-element">
<media:image asset="{headerimage}" alt="{title}" maximumHeight="465" />
<h2>{title}</h2>
{neos:contentElement.editable(property: 'teaser')}
<p><neos:link.node node="{node}" class="btn btn-default">Details about this</neos:link.node></p>