View gist:350e3db6dfaa1a7aebfcab4c8a63df43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch | egrep -v "(^\*|master|dev)" | xargs git branch -d |
View file.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
$queryParser = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class); | |
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL()); |
View clear_gitlab_runner_cache.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps -f status=exited | grep "\-cache-" | awk '{print $1}' | xargs docker rm |
View get_jira_tasks_from_commits.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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,"}' |
View page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 = / |
View customList.tex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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}} |
View hashStringFunction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param $string string The string/password to be hashed | |
* @param $salt string The salt that will be added to the string | |
* @param $rounds int Number of rounds | |
* @param $algo string The algorithm that should be used for hashing | |
* @return string Returns the hashed string | |
*/ | |
function createHash($string, $salt = '', $rounds = 500, $algo = 'sha256') { |
View router.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Filename of requested file... | |
$requested = __DIR__ . $_SERVER['REQUEST_URI']; | |
// If file exists use file | |
if (file_exists($requested) && !is_dir($requested)) { | |
return false; | |
} |
View ModelAdmin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) { |
View InvoiceAdmin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InvoiceAdmin extends Admin | |
{ | |
// ... | |
protected function configureListFields(ListMapper $list) | |
{ | |
$list | |
->addIdentifier('name') | |
// Use "trans" type to translate the given value |