Skip to content

Instantly share code, notes, and snippets.

@Digi92
Digi92 / restart-application
Created December 8, 2016 02:49
Self relaunch of Swift Cocoa application Find on: https://gist.github.com/ericdke/75a42dc8d4c5f61df7d9
let task = NSTask();
task.launchPath = "/bin/sh";
task.arguments = ["-c", "sleep 0.2; open \"\(NSBundle.mainBundle().bundlePath)\""];
task.launch();
NSApplication.sharedApplication().terminate(nil);
@Digi92
Digi92 / PHPUnit_Exception_setPsr4
Created November 16, 2016 16:31
PHPUnit Test Fail with "PHPUnit_Framework_Exception: PHP Fatal error: Call to undefined method Composer\Autoload\ClassLoader::setPsr4()"
Wenn die Funktionalen Test fehlschlagen liegt das im TYPO3 an der Extension "phpunit".
1. Gehe in den Ordner "/htdocs/typo3conf/ext/phpunit/Composer/"
2. Führe den Befehl "composer dump-autoload" aus.
Jetzt sollte es funktionieren!
@Digi92
Digi92 / Oops, an error occurred! Code:
Created October 10, 2016 14:08
TYPO3 7 Oops, an error occurred! Code: 201503311214108a7550a0 Without 10 = IMAGE I get the correct Image, but with 10 = IMAGE etc. I get the error "Oops, an error occurred! Code: 201503311214108a7550a0". There are no more information in the logs neither typo3.log nor error_log. Turn off the error handling with config.contentObjectExceptionHandle…
config.contentObjectExceptionHandler = 0
@Digi92
Digi92 / 404-Handler-extbase.php
Created October 7, 2016 10:34
Call the 404 Page Handling process. Page-not-found handler for use in frontend plugins from extensions.
<?php
/** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $GLOBALS['TSFE'] */
$GLOBALS['TSFE']->pageNotFoundAndExit();
@Digi92
Digi92 / install-Oh-My-Zsh-Windows
Created October 4, 2016 21:50
Oh-My-Zsh mit dem Theme "agnoster" installieren unter Windows Anleitung URL: http://blog.nevercodealone.de/oh-my-zsh-agnoster-theme-windows/
Viele arbeiten unter Linux mit oh-my-zsh als Shell. Doch manchmal macht es die Projektsituation erforderlich, dass man unter Windows arbeiten muss – ohne dabei aber auf den Komfort von oh-my-zsh verzichten zu wollen. In diesem Beitrag erfährst du, warum oh-my-zsh auch für native Windows User interessant sein kann und wie oh-my-zsh mit dem Agnoster Theme auf Windows installiert wird.
Es ist unter Windows nicht sehr komfortabel, auf der CMD oder auf der Powershell zu arbeiten. Meistens muss die CMD auch nicht benutzt werden. Doch auch unter Windows gibt es Anwendungen, die sich komfortabler auf einer Shell bedienen lassen als über eine GUI. Beispiel wäre die Anwendung git. Git liefert eine Git Bash für Windows mit. Diese macht das Arbeiten mit Git schon etwas „bequemer“ als unter CMD. Das kann aber mit oh-my-zsh und dem git Plugin noch verbessert werden.
Babun Installation und Konfiguration
Kommen wir dazu, wie oh-my-zsh auf Windows installiert wird. Dabei wird oh-my-zsh nicht direkt installiert, sondern über
@Digi92
Digi92 / install-Oh-My-Zsh
Last active October 4, 2016 21:45
Oh-My-Zsh mit dem Theme "agnoster" installieren
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
#$ git clone https://github.com/powerline/fonts.git
$ ./install.sh
Theme ändern
$ cd
$ vi .zshrc
Einsetzen/Ersetzen: ZSH_THEME="agnoster
Istallieren des Font Patches
@Digi92
Digi92 / styled_debug.php
Last active September 1, 2016 11:01
Styled debug
<?php
echo '<pre>' . var_export($result, true) . '</pre>';
?>
@Digi92
Digi92 / mapArrayToModel.php
Created June 2, 2016 09:34
Map a array into a model with all sysmodels
<?php
$rows = array(
0 => array()
);
$className = 'Denkwerk\DwContentElements\Domain\Model\DownloadFileGroup';
/*** @var $extbaseObjectManager \TYPO3\CMS\Extbase\Object\ObjectManager */
$extbaseObjectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
/*** @var $dataMapper \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper */
@Digi92
Digi92 / NewTag
Last active November 2, 2016 00:17
Add new Git Tag to repo
git tag -a 0.1.4 -m 'New version 0.1.4'
git push --tags