Skip to content

Instantly share code, notes, and snippets.

@tap52384
tap52384 / README.md
Last active August 1, 2023 10:10
Install Windows on External Drive for macOS
@mficzel
mficzel / ExampleController.php
Last active June 7, 2019 06:26
Backend Module with Fusion-AFX
<?php
namespace Test\BeModule\Controller;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\View\ViewInterface;
use Neos\Fusion\View\FusionView;
use Neos\Neos\Controller\Module\AbstractModuleController;
class ExampleController extends AbstractModuleController
{
@Sebobo
Sebobo / InstanceUserService.php
Created April 26, 2018 14:39
Dynamic Policies
<?php
namespace Foo\Bar\Service;
use Neos\Cache\CacheAwareInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\Domain\Model\User;
/**
* The user service provides general context information about the currently
* authenticated backend user.
@albe
albe / AbstractRestController.php
Created May 30, 2017 08:28
Automagic RESTful API for https://github.com/neos/flow Framework Aggregates (incomplete)
<?php
namespace Acme\Api\Controller;
use Acme\Api\Domain\Repository\ResourceRepository;
use Acme\Api\Utility\AggregateReflectionHelper;
use Acme\Api\Utility\ResourceTypeHelper;
use Acme\Api\Utility\ViewConfigurationHelper;
use Doctrine\Common\Inflector\Inflector;
@DavidSporer
DavidSporer / Settings.yaml
Last active September 15, 2020 10:04
Settings.yaml with relative symlinks
Neos:
Flow:
resource:
targets:
localWebDirectoryPersistentResourcesTarget:
target: 'Neos\Flow\ResourceManagement\Target\FileSystemSymlinkTarget'
targetOptions:
relativeSymlinks: TRUE
subdivideHashPathSegment: TRUE
localWebDirectoryStaticResourcesTarget:
@htuscher
htuscher / LanguageMenu.ts2
Created February 23, 2016 10:33
Neos TypoScript2 condition LanguageMenu if dimension exists
languageMenu = TYPO3.Neos:DimensionMenu {
dimension = 'language'
templatePath = 'resource://Vendor.Package/Private/Templates/TypoScriptObjects/LanguageMenu.html'
@if.condition = ${Type.className(q(node).context({'dimensions': {'language': ['en']}, 'targetDimensions': {'language': 'en'}}).get(0)) == 'TYPO3\TYPO3CR\Domain\Model\Node'}
}
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@htuscher
htuscher / UrlCommandController.php
Last active July 31, 2018 12:03
Create frontend URIs from neos backend (CLI)
<?php
namespace Vendor\Site\Command;
use Vendor\Site\Service\SocialSharesService;
use TYPO3\Eel\FlowQuery\FlowQuery;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Cli\CommandController;
use TYPO3\Flow\Configuration\ConfigurationManager;
use TYPO3\Flow\Http\Request;
@bwaidelich
bwaidelich / PurifyViewHelper.php
Created July 20, 2015 14:36
Fluid ViewHelper integrating HTMLPurifier to sanitize/tidy HTML output
<?php
namespace Your\Package\ViewHelpers\Format;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* ViewHelper rendering the given HTML string through HTMLPurifier
*/
class PurifyViewHelper extends AbstractViewHelper {
@aertmann
aertmann / Caches.yaml
Last active January 16, 2017 14:15
Keep session storage through cache flushing to prevent users being logged out in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
# Flow 3.0+
Flow_Session_Storage:
persistent: TRUE
Flow_Session_MetaData:
persistent: TRUE
# Flow 2.0-2.3 (only works with Surf deployment – not flow:cache:flush command)
Flow_Session_Storage:
backendOptions: