Skip to content

Instantly share code, notes, and snippets.

@fabarea
fabarea / FeatureContext.php
Created July 18, 2013 11:42
Behat - step for browsing all pages of site map
<?php
use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Context\BehatContext,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
use Behat\MinkExtension\Context\MinkContext;
if (!empty($GLOBALS['TCA'][$rowMmRefInfo['tablenames']]['ctrl']['languageField'])) {
$fields .= ',sys_language_uid';
}
$existingReferenceForeign = $this->damfalfileRepository->selectOneRowQuery($fields, $rowMmRefInfo['tablenames'], "uid = '" . $rowMmRefInfo['uid_foreign'] . "' and deleted != 1");
if (!empty($GLOBALS['TCA'][$rowMmRefInfo['tablenames']]['ctrl']['languageField'])) {
$existingReferenceForeign["sys_language_uid"] = 0;
}
@fabarea
fabarea / remove_closing_tags.sh
Created February 11, 2014 15:05
Recursively remove the php closing tag `?>` and any following blank lines from the end of any PHP file. Source directories can be configured.
#!/bin/bash
###############################
# Recursively remove the closing php tag `?>` and any following blank lines from the
# end of any PHP file. Source directories can be configured.
#
# Author: Fabien Udriot <fabien.udriot@ecodev.ch>
# Date: 2014-02-11
###############################
@fabarea
fabarea / composer.json
Created April 3, 2014 21:14
Composer typo3/cms-base-distribution
{
"name": "typo3/cms-base-distribution",
"description": "TYPO3 CMS base distribution",
"type": "project",
"minimum-stability": "dev",
"config": {
"vendor-dir": "Packages/Libraries",
"bin-dir": "bin"
},
"require": {

SALTSTACK

Location: Freiburg Date: 29.05.14

  • deklartive: Puppet, Chef, Cfengine
  • imperative: ansible, fabric - macht was aktiv auf
  • real Welt: Salt kann beides
@fabarea
fabarea / NavigationMain.html
Created September 25, 2014 21:05
Bug if variable contains in "as" (foo in this example) is different than "menu"
<v:page.menu as="foo">
<f:for each="{foo}" as="item">
<a href="{item.link}">{item.title}</a><br />
<v:page.menu.sub pageUid="{item.uid}" />
</f:for>
</v:page.menu>
@fabarea
fabarea / gist:aaa973dcf15b7485fd49
Created February 19, 2015 08:21
TYPO3 CMS - CLI script for adjusting Flux syntax to latest
#!/usr/bin/env php
<?php
# Tip: backup your source beforehand ;)
# Adjust your path to your extension containing the Flux code.
$directory = '~/Sites/Ecodev/speciality.distribution/htdocs/typo3conf/ext/';
$replaceNamespaces = array(
'{namespace flux=Tx_Flux_ViewHelpers}' => '{namespace flux=FluidTYPO3\Flux\ViewHelpers}',
);
@fabarea
fabarea / 01-Problem.md
Last active May 17, 2017 07:27
Problem decoding URL with Neos
@fabarea
fabarea / Docker
Last active November 28, 2019 06:21
Docker Example Doxygen
FROM ubuntu
MAINTAINER "Fabien Udriot" <fabidule@omic.ch>
# Install doxygen dependencies
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt -y install graphviz \
&& apt -y install doxygen
# NOTE: must use json syntax process is not started in a subshell (and signals are passed correctly)
@fabarea
fabarea / Docker
Created November 28, 2019 09:14
Docker example PHP
FROM php:7.2
ENV APP_DIR /app
ENV APPLICATION_ENV development
WORKDIR $APP_DIR
VOLUME $APP_DIR
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php'); \
\$sig = file_get_contents('https://composer.github.io/installer.sig'); \