Skip to content

Instantly share code, notes, and snippets.

View cedricziel's full-sized avatar
🥸

Cedric Ziel cedricziel

🥸
View GitHub Profile
@cedricziel
cedricziel / Project.java
Last active August 29, 2015 14:24
Configuring Entity wrapping with Spring Data Rest. Ember Data HAL 9000 for example requires this.
package com.cedricziel.tcagen.backend.domain;
@Data
@NoArgsConstructor
@Entity
@Table(name = "projects")
// JsonRootDetermines the enclosuere for the entity in json responses
@JsonRootName("project")
public class Project implements Serializable {
// ..
<?php
/* SchwafelSchwafel, Schwafel! */
class CoolClass_Neu {
/**
* @return void
*/
public function doEtwas() {
<?php
namespace CedricZiel\Lister\ViewHelpers\Angular;
/**
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
➜ typo3_src-git git:(assetAttrs) ✗ php -d memory_limit=1G bin/phpunit -c typo3/sysext/core/Build/UnitTests.xml
PHPUnit 4.1.6 by Sebastian Bergmann.
Configuration read from /home/cziel/lib/typo3_src-git/typo3/sysext/core/Build/UnitTests.xml
................S............................................ 61 / 6574 ( 0%)
............................................................. 122 / 6574 ( 1%)
............................................................. 183 / 6574 ( 2%)
............................................................. 244 / 6574 ( 3%)
............................................................. 305 / 6574 ( 4%)
@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(
@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 / CustomNewsContent.html
Created March 23, 2015 19:31
Quick rendering of ce's with a custom template overlay
<f:for each="{newsItem.contentElements}" as="element">
<f:if condition="{element.CType} == 'text'">
<f:comment>
This is a text element, you could vary the rendering depending on multiple conditions:
* CType
* layout
* frame
You would separate those into partials
</f:comment>
<h{element.headerLayout}>
@cedricziel
cedricziel / composer.json
Created February 19, 2015 15:24
TYPO3 CMS example composer.json with adjuste CMS core package
{
"name": "websight/institute",
"description": "",
"type": "typo3-cms-extension",
"version": "0.1",
"autoload": {
"psr-4": {
"Websight\\Institute\\": "Classes/"
},
"classmap": [
@cedricziel
cedricziel / FooController.php
Created February 17, 2015 10:43
External Service Example
class FooController extends ActionController {
/**
* @var \Vnd\Ext\Service\ItemService
* @inject
*/
protected $itemService;
pubflic function fooAction() {
// Simple here, dont forget proper exception handling
$this->view->assign('items', $this->itemService->getProcessedItems());
Server Startup time Time (2000req)
Tomcat 8 Time taken for tests: 104.005 seconds
Jetty 9 Started Application in 238.348 seconds (JVM running for 251.405) Time taken for tests: 38.721 seconds
Undertow Started Application in 182.299 seconds (JVM running for 193.78) ime taken for tests: 69.272 seconds