Skip to content

Instantly share code, notes, and snippets.

View kaystrobach's full-sized avatar
🎯
Focusing

Kay Strobach kaystrobach

🎯
Focusing
View GitHub Profile
@kaystrobach
kaystrobach / IconUtility.php
Last active August 29, 2015 14:06
iconOverlay
<?php
namespace KayStrobach\Themes\Hook;
use KayStrobach\Themes\Utilities\CheckPageUtility;
/**
* Class PageNotFoundHandlingHook
*
* @package KayStrobach\Themes\Hook
@kaystrobach
kaystrobach / VAGRANTFILE
Last active August 29, 2015 14:06
Vagrantfile for NFS Windows
# -*- mode: ruby -*-
# vi: set ft=ruby :
print "You may be asked for your sudo password to use NFS shares\n"
print "More Information: https://docs.vagrantup.com/v2/synced-folders/nfs.html\n\n"
unless Vagrant.has_plugin?("vagrant-vbguest")
print "please execute the following command to enable automated vbguest installation\n\n"
print "vagrant plugin install vagrant-vbguest"
@kaystrobach
kaystrobach / VAGRANTFILE
Created September 12, 2014 08:58
Vagrantfile snippet NFS for *unix and SMB for windows!
if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
print "Welcome to the MS Windows hell\n\n"
print "Please confirm the UAC messages, but still the network will be slow\n\n"
config.vm.synced_folder ".", "/serverdata", owner: "www-data", group:"www-data"
else
print "You are not running Windows ... thank god!\n\n"
print "You may be asked for your sudo password to use NFS shares\n"
print "More Information: https://docs.vagrantup.com/v2/synced-folders/nfs.html\n\n"
config.vm.synced_folder ".", "/serverdata", type: "nfs" #, owner: "www-data", group:"www-data"
end
@kaystrobach
kaystrobach / createFolder.php
Created September 10, 2014 09:19
Create a folder in TYPO3.Surf
$workflow->defineTask(
'vendor.package:createfolder',
'typo3.surf:shell',
array(
'command' => 'mkdir {releasePath}/someGreatFolder',
'logOutput' => TRUE
)
);
@kaystrobach
kaystrobach / FormErrors.html
Created November 19, 2013 08:47
#TYPO3 #FLOW Translated Form Errors
<f:form.validationResults for="{for}">
<f:if condition="{validationResults.flattenedErrors}">
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true" title="Schließen">&times;</button>
<p>
Leider waren einige Eingaben im Formular nicht korrekt.
</p>
<f:for each="{validationResults.flattenedErrors}" key="propertyPath" as="errors">
<div class="row">
<div class="col-md-3">
@kaystrobach
kaystrobach / Alternative as AOP Aspect.php
Last active December 28, 2015 12:19
Shows how to integrate Symfony console as proof of concept
<?php
namespace KayStrobach\Project\Aspects;
use TYPO3\Flow\Annotations as Flow;
/**
* Wraps around the \TYPO3\Flow\Cli\Response
*
* @Flow\Aspect
@kaystrobach
kaystrobach / Doctrine Markdown
Last active December 23, 2015 18:29
FLOW Documentation
Doctrine in TYPO3 FLOW ORM/* {#doctrine}
===================================
Einfache Datentypen (Attribute)
-------------------------------
@code
class Blog {
/**
* @var string
public function findAllByCoordinatesDistance($coordinates, $distance) {
$earthRadius=6367.41;
if($distance[strlen($distance)-1] = 'm'){
$earthRadius=$earthRadius/1.609;
$distance = intval($distance);
}
// prepare for injections
$distance = floatval($distance);