Skip to content

Instantly share code, notes, and snippets.

View hlubek's full-sized avatar

Christopher Hlubek hlubek

View GitHub Profile
@hlubek
hlubek / Settings.yaml
Created March 23, 2018 15:06
Activate DebugExceptionHandler in Production
Neos:
Flow:
error:
exceptionHandler:
className: 'Neos\Flow\Error\DebugExceptionHandler'
defaultRenderingOptions:
renderTechnicalDetails: true
@hlubek
hlubek / valueobjects.go
Created September 26, 2017 09:10
Value objects in Go with private fields
package valueobjects
import (
"encoding/json"
"fmt"
)
type NodeIdentifier struct {
identifier string
}
@hlubek
hlubek / FilterOperation.php
Last active September 18, 2017 09:13
Extended FlowQuery FilterOperation with array support (reference and references)
<?php
namespace MyProject\Neos\Blog\Eel\FlowQueryOperations;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;
/**
* Override the default FilterOperation to support filtering of NodeInterface values
* (reference) by identifier (with "=") or references by containing a value ("*=")
*/
class FilterOperation extends \TYPO3\TYPO3CR\Eel\FlowQueryOperations\FilterOperation
@hlubek
hlubek / README.md
Last active September 30, 2015 10:58 — forked from mbostock/.block
Donut Chart

This donut chart is constructed from a CSV file storing the populations of various age groups. The chart employs a number of D3 features:

@hlubek
hlubek / NodeImportServiceTest.php
Created September 30, 2015 10:24
Test for date properties in the node import
<?php
/**
* @test
*/
public function importSingleNode()
{
$xmlReader = new \XMLReader();
$result = $xmlReader->open(__DIR__ . '/Fixtures/SingleNode.xml');
@hlubek
hlubek / List.Something.html
Created December 19, 2014 08:51
Reusing Fluid templates with sections in Neos
<div>
<h1>List of something</h1>
...
<ul>
<!-- This will not be rendered by default -->
<f:section name="item">
<li>
{itemNode.properties.title}
</li>
</f:section>
@hlubek
hlubek / Root.ts2
Last active August 29, 2015 14:11
Content dimension presets for translation in Neos 1.2
# Show only "pure" languages in frontend language menu
languageMenu = TYPO3.Neos:DimensionMenu {
dimension = 'language'
presets = ${['en', 'de']}
templatePath = 'resource://TYPO3.NeosDemoTypo3Org/Private/Templates/TypoScriptObjects/LanguageMenu.html'
}
@hlubek
hlubek / joined.sql
Last active August 29, 2015 14:11
Inline querying reduced nodes in TYPO3CR
SELECT
t0_.persistence_object_identifier AS persistence_object_identifier0, t0_.version AS version1, t0_.pathhash AS pathhash2, t0_.path AS path3, t0_.parentpathhash AS parentpathhash4, t0_.parentpath AS parentpath5, t0_.identifier AS identifier6, t0_.sortingindex AS sortingindex7, t0_.removed AS removed8, t0_.dimensionshash AS dimensionshash9, t0_.hiddenbeforedatetime AS hiddenbeforedatetime10, t0_.hiddenafterdatetime AS hiddenafterdatetime11, t0_.dimensionvalues AS dimensionvalues12, t0_.properties AS properties13, t0_.nodetype AS nodetype14, t0_.hidden AS hidden15, t0_.hiddeninindex AS hiddeninindex16, t0_.accessroles AS accessroles17, t0_.workspace AS workspace18, t0_.contentobjectproxy AS contentobjectproxy19, t0_.movedto AS movedto20
FROM
typo3_typo3cr_domain_model_nodedata t0_
INNER JOIN typo3_typo3cr_domain_model_nodedimension t1_ ON t0_.persistence_object_identifier = t1_.nodedata AND (t1_.name = 'language')
INNER JOIN (
SELECT
t2_.identifier, t2_.pathhash, MIN(LOCATE(CONCAT(t2_.workspace, '
@hlubek
hlubek / gist:d16912cfb68fed8eb30a
Created September 10, 2014 13:35
Mac Ports Install PostgreSQL
sudo mkdir -p /opt/local/var/db/postgresql92/defaultdb
sudo chown postgres:postgres /opt/local/var/db/postgresql92/defaultdb
sudo su postgres -c '/opt/local/lib/postgresql92/bin/initdb -D /opt/local/var/db/postgresql92/defaultdb'
# Follow https://coderwall.com/p/xezzaa for user creation and setup on Mac OS X
sudo port select postgresql postgresql92
@hlubek
hlubek / gist:c552c45e0bf1b83e1bd1
Created September 1, 2014 11:41
TYPO3 Neos: Add a JavaScript include from another package
// Extend the Page prototype
prototype(TYPO3.Neos.NodeTypes:Page) {
// body or head depending on the position
body.javascripts {
prism = TYPO3.TypoScript:Tag {
tagName = 'script'
attributes {
src = TYPO3.TypoScript:ResourceUri {
path = 'resource://Networkteam.LearnNeos/Public/Scripts/Vendor/prism.js'
}