Skip to content

Instantly share code, notes, and snippets.

View dfeyer's full-sized avatar

Dominique Feyer dfeyer

View GitHub Profile
@dfeyer
dfeyer / host-manager
Created November 16, 2011 10:17 — forked from nddrylliog/host-manager
A command-line utility to manage the /etc/hosts file.
#!/bin/bash
# Idea and interface taken from https://github.com/macmade/host-manager
path="/etc/hosts"
addusage="Usage: `basename $0` --add host address"
remusage="Usage: `basename $0` --remove host"
listusage="Usage: `basename $0` --list [127.]"
case "$1" in
--add)
if [ $# -eq 3 ]; then
@dfeyer
dfeyer / gist:3143282
Created July 19, 2012 11:52
Add LOAD_REGISTER to Tx_Fed_ViewHelpers_Page_RenderContentViewHelper
<?php
/**
* ViewHelper used to render content elements in Fluid page templates
*
* @author Claus Due, Wildside A/S
* @author Dominique Feyer <dfeyer@ttree.ch>
* @package Fed
* @subpackage ViewHelpers/Page
*/
<f:layout name="Backoffice"/>
<f:section name="PageHeader">
<f:render partial="Backoffice/PageHeader" arguments="{module: 'domainPreferences', configuration: settings.backoffice.domainPreferences.actionMenu}"/>
</f:section>
<f:section name="Content">
<div class="container">
<f:form action="update" object="{domain}" name="domain" class="form-horizontal well" enctype="multipart/form-data">
<f:render partial="Model/Domain/PreferencesProperty" arguments="{_all}"/>
<?php
namespace Ttree\Medialib\Core\Security;
/* *
* This script belongs to the FLOW3 package "Ttree.Medialib". *
* *
* 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. *
* *
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml"
version='1.0'
encoding='UTF-8'
indent="yes"/>
<xsl:template name="badge">
<xsl:if test="status = 'approved'">
<?php
namespace Ttree\Medialib\Backoffice\Service\Account\Import;
/* *
* This script belongs to the FLOW3 package "Ttree.Medialib". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Security\Account;
use TYPO3\Flow\Utility\Now;
@dfeyer
dfeyer / MovieRepository.php
Last active December 16, 2015 19:48
TYPO3.ElasticSearch Query API proposal
<?php
namespace Ttree\Medialib\Core\Domain\Repository\ElasticSearch;
/* *
* This script belongs to the FLOW3 package "Ttree.Medialib". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
<?php
namespace Ttree\Medialib\Core\Domain\Repository\Aspect;
/* *
* This script belongs to the FLOW3 package "Ttree.Medialib". *
* *
* */
use Ttree\Medialib\Core\Exception;
use TYPO3\Flow\Annotations as Flow;
<?php
namespace Ttree\Medialib\Analytics\Query\AST;
/* *
* This script belongs to the FLOW3 package "Ttree.Medialib". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
use \Doctrine\ORM\Query\AST\Functions\FunctionNode;
@dfeyer
dfeyer / gist:6308453
Created August 22, 2013 15:09
How to get a parent page in the current rootline with a defined property set with TypoScript2 / EEL for TYPO3 Neos. The current EEL expression take all the parents nodes of the current node, with the property backgroundImage setted, add the current node, filter based on backgroundImage content, get the last Node, and return the property. Complex…
${q(node).parents('[backgroundImage]').add(q(node)).filter('[backgroundImage]').last().property('backgroundImage')}