Skip to content

Instantly share code, notes, and snippets.

View cedricziel's full-sized avatar
🥸

Cedric Ziel cedricziel

🥸
View GitHub Profile
@cedricziel
cedricziel / BookingPageOneValidator.php
Created April 17, 2015 07:16
Dynamic Validation on controller level
<?php
namespace Websight\MyExt\Validation;
/***************************************************************
* Copyright notice
*
* (c) 2015 Cedric Ziel <cedric@cedric-ziel.com>
* (c) 2014 Carsten Bleicker <carsten@bleicker.de>
* All rights reserved
@cedricziel
cedricziel / ext_tables.php
Created May 4, 2015 20:47
Add a custom doktype to TYPO3 pages table
<?php
/**
* Custom Doktypes
*/
// Define a new doktype
$customShortlinkDoktype = 120;
$customPageIcon = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/Shortlink.png';
// Add the new doktype to the list of page types
$GLOBALS['PAGES_TYPES'][$customShortlinkDoktype] = array(

Keybase proof

I hereby claim:

  • I am cedricziel on github.
  • I am cedricziel (https://keybase.io/cedricziel) on keybase.
  • I have a public key ASAfgwH_iPnBRuetEupEV-aAKQeFZyvkiw-Rop-5rRCSogo

To claim this, I am signing this object:

@cedricziel
cedricziel / Demo.html
Last active August 23, 2017 07:48
Simple SlimScroll directive for AngularJS. Requires jQuery, AngularJS and the jQuery SlimScroll (http://rocha.la/jQuery-slimScroll) Plugin.
<!-- place plugin configuration on rather the "slimScrollConfig" global value
or override it when needed -->
<div slim-scroll="{height: '500px'}"></div>
@cedricziel
cedricziel / RealUrlAutoconfHook.php
Created February 1, 2017 12:37
Find all plugins of a specific type and attach fixedPostVars to them
<?php
namespace My\Ext\Hooks;
use TYPO3\CMS\Backend\Utility\BackendUtility;
class RealUrlAutoconfHook {
/**
* @param array $params
@cedricziel
cedricziel / composer.json
Created January 13, 2017 08:07
Tools with tooly
{
"require": {
"tm/tooly-composer-script": "^1.2"
},
"require-dev": {
"escapestudios/symfony2-coding-standard": "~2.0"
},
"scripts": {
"post-install-cmd": [
config.tx_extbase {
persistence {
classes {
Vendor\MyExt\Domain\Model\Address {
mapping {
tableName = tt_address
# optional. if you have added additional fields f.e.
columns {
tx_foo_description.mapOnProperty = description
tx_foo_my_other_column.mapOnProperty = unusualPropertyName
<?php
namespace AppBundle\Routing;
use AppBundle\Entity\RoutableEntityInterface;
use JMS\I18nRoutingBundle\Router\I18nRouter;
/**
* Class Router
* Overrides the I18n router to be able to resolve objects by route
@cedricziel
cedricziel / app.env.PLAY_OPTS
Last active November 17, 2016 23:14
Deploy a Play! Framework Application behind nginx -> haproxy -> netty (Play2 core) for transient upgrading. This setup fully supports Websockets in almost any variation. - But most importantly uses 2 instances minimum to allow seamless upgrade. Prepare the instances with "cd app/instances/$instance && ~/app/play/play clean compile stage"
fooapp@srv:~$ cat app/env/PLAY_OPTS
export DATABASE_URL="jdbc:postgresql://127.0.0.1/foobar"
# We could wire a different configuration file here
# or set up a different database on the fly
export PLAY_OPTS="-DapplyEvolutions.default=true -DapplyDownEvolutions.default=true -Ddb.default.url="$DATABASE_URL" -Ddb.default.user=fooapp -Ddb.default.password=fooapppw -Ddb.default.driver=org.postgresql.Driver"
# Configuration/Production/Settings.yaml
# ...
TYPO3:
Flow:
core:
phpBinaryPathAndFilename: '/usr/local/bin/php7-70STABLE-CLI'