Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / Image Resize_Scaling
Created March 1, 2017 14:33
ImageMagic Bilder auf eine Größe eine Größe Skalieren womit es die Weite und Höhen angaben mittels Cropping erfüllen kann. Das ergebnis Bild hat dann angegebene Höhe und Breite bekommen. URL: http://www.imagemagick.org/Usage/resize/
convert dragon.gif -resize 64x64^ -gravity center -extent 64x64 fill_crop_dragon.gif
@Digi92
Digi92 / Filter_Function.php
Last active March 8, 2017 14:57
Find entry by object property from a array of objects
<?php
// Note: This will return all results with if true
$neededObject = array_filter(
$arrayOfObjects,
function ($element) use (&$searchedValue) {
/**@var element $element*/
return $element->id == $searchedValue;
}
);
## Lang = de, falls de default-Sprache
page {
config {
htmlTag_stdWrap {
cObject = TEXT
cObject.value (
<!--[if lt IE 7]> <html lang="de" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html lang="de" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html lang="de" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="de" class="no-js"> <!--<![endif]-->
@Digi92
Digi92 / doctrine_on_update_CURRENT_TIMESTAMP.php
Last active October 1, 2018 08:51
Doctrine Add "on Update CURRENT_TIMESTAMP" to a field
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Example
* @package AppBundle\Entity
* @ORM\Entity
* @ORM\Table(name="example")
@Digi92
Digi92 / doctrine_default_value.php
Last active April 15, 2017 20:57
Doctrine Add default field value.
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Example
* @package AppBundle\Entity
* @ORM\Entity
* @ORM\Table(name="example")