Instantly share code, notes, and snippets.

# Markus Poerschkemarkuspoerschke

• Sort options
Created May 7, 2020
Remove all branches except master
View gist:350e3db6dfaa1a7aebfcab4c8a63df43
 git branch | egrep -v "(^\*|master|dev)" | xargs git branch -d
Created Sep 7, 2012
 class ModelAdmin extend Admin { // ... public function validate(ErrorElement $errorElement,$object) { // find object with the same uniqueField-value $other =$this->modelManager->findOneBy($this->getClass(), array('uniqueField' =>$object->getUniqueSlug())); if (null !== $other && !$other->equals($object)) { Created Apr 4, 2019 Get SQL query as string from Extbase Query View file.php  objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class); \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL()); Created Nov 29, 2017 Clear GitLab Runner cache View clear_gitlab_runner_cache.sh  docker ps -f status=exited | grep "\-cache-" | awk '{print$1}' | xargs docker rm
Last active Nov 29, 2017
Get Jira task-keys from commit messages.
 # This will get all task keys that are relevant for the version 2.5.0 release git log 2.4.0..2.5.0 --pretty=oneline | perl -ne '{ /(\w+)-(\d+)/ && print "$1-$2,"}'
Last active Dec 19, 2015
View page.ts
 # In your TypoScript you should add the absolute prefix # or URL would look like this: http://www.example.com/var/www/news/mein-artikel config.absRefPrefix = /
Created Apr 25, 2013
Create a custom list for LaTeX. For my final paper for a degree as computer specialist I needed to add a glossary and a table of acronyms. I did not want to use a package. For this reason I looked for a simple solution: \newenviroment offers the possibility to define a custom list. Here is an Example on how to define a custom list.
View customList.tex
 % Custom list for glossary \newenvironment{glossarydescription}{ \begin{list}{}{ \setlength{\labelsep}{0mm} % space before text. \setlength{\labelwidth}{44mm} % width of the label. \setlength{\leftmargin}{44mm} % adjust margin. same size as labelwidth. \renewcommand{\makelabel}[1]{\textbf{##1\space}\dotfill\space} % \dotfill creates a line of dots. you can also use \hfill } } {\end{list}}
Created Jan 23, 2013
Simple hashing function in PHP. Any alogrithm supported by the build in hash() function can be used. This function actually only adds rounds and concatenate the string with a salt.
Created Oct 7, 2012
Simple router.php for using the PHP 5.4 built-in webserver
View router.php

Created Sep 5, 2012
 class InvoiceAdmin extends Admin { // ... protected function configureListFields(ListMapper $list) {$list ->addIdentifier('name') // Use "trans" type to translate the given value