Skip to content

Instantly share code, notes, and snippets.

@kmcs
kmcs / CalendarizeCalendarController.php
Created September 6, 2018 11:39
TYPO3 calendarize ics all day events end date is not correct workaround
namespace My\Extension;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class CalendarizeCalendarController
{
/**
* @param $index \HDNET\Calendarize\Domain\Model\Index
* @param $domain string
@kmcs
kmcs / wait-for
Created September 27, 2017 06:06
centos wait-for port open
#!/bin/sh
# @see https://github.com/Eficode/wait-for
# install nmap on centos
TIMEOUT=15
QUIET=0
echoerr() {
if [ "$QUIET" -ne 1 ]; then printf "%s\n" "$*" 1>&2; fi
@kmcs
kmcs / typo3_typoscript_extbase.php
Created October 20, 2016 09:07
How to use TypoScript in extbase controller TYPO3 7.6.11
$cObj = $this->configurationManager->getContentObject();
$resizedFile = $cObj->cObjGetSingle('IMG_RESOURCE', array(
'file' => $file->getPublicUrl(),
'file.' => array(
'maxW' => '160',
'maxH' => '160c',
)
));
@kmcs
kmcs / KeepFileNameHashLocationStrategy.ts
Created June 17, 2016 08:48
keep path location of HashLocationStrategy #angular2 #router
import {Injectable} from "@angular/core";
import {Location, HashLocationStrategy, PlatformLocation} from "@angular/common";
@Injectable()
export class KeepFileNameHashLocationStrategy extends HashLocationStrategy {
constructor(_platformLocation: PlatformLocation, _baseHref?: string) {
super(_platformLocation, _baseHref);
}
prepareExternalUrl(internal: string): string {
@kmcs
kmcs / migrate_typo3_kb_nescefe2gridelements.php
Last active May 5, 2016 19:16
Migrate TYPO3 kb_nescefe tt_content database entries to gridelements
<?php
$dbhost = "localhost";
$dbname = "";
$dbuser = "";
$dbpswd = "";
$mapColPos = array(
0 => 10,
1 => 11