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 / 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 / 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 / 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 / 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
<?php
class Tx_beskin_Be_PreHeaderRenderHook {
function main($arg) {
/** @var \t3lib_PageRenderer $pagerenderer*/
$pagerenderer = $arg['pageRenderer'];
$extConfigs = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['beskin']);
$paths = array ();
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>
@kaystrobach
kaystrobach / jQuerySelectElement.js
Created October 28, 2014 14:08
jQuery: SelectElement: use $('#passwordVisible').selectElement();
$.fn.selectElement = function() {
var text = $(this).get(0);
var range = null;
if (document.body.createTextRange) { // ms
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) { // moz, opera, webkit
var selection = window.getSelection();
@kaystrobach
kaystrobach / keybase.md
Created February 20, 2015 18:02
keybase.md

Keybase proof

I hereby claim:

  • I am kaystrobach on github.
  • I am kaystrobach (https://keybase.io/kaystrobach) on keybase.
  • I have a public key whose fingerprint is 123F E8E3 C364 C8B5 BAB3 E358 6A25 38B4 6DA3 F62F

To claim this, I am signing this object:

@kaystrobach
kaystrobach / GetRecordAsViewHelper.php
Created September 17, 2015 09:47
An ugly viewHelper to get a record from the database ...
<?php
namespace Vendor\Extension\ViewHelpers;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
class GetRecordAsViewHelper extends AbstractViewHelper {
/**
* @param string $table
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);