Skip to content

Instantly share code, notes, and snippets.

View htuscher's full-sized avatar

Hans Tuscher htuscher

View GitHub Profile
@htuscher
htuscher / get_remote_branches.sh
Created July 24, 2013 08:14
Clone all remote branches and track
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
git branch --track ${branch#remotes/origin/} $branch
done
@htuscher
htuscher / new_gist_file
Created August 31, 2013 09:06
How to move recent commits to a new branch
git branch newbranch
git reset --hard HEAD~3 # Go back 3 commits. You *will* lose uncommitted work.
git checkout newbranch
@htuscher
htuscher / new_gist_file
Created August 31, 2013 09:07
How to move recent commits into an existing branch
git checkout existingbranch
git merge master
git checkout master
git reset --hard HEAD~3 # Go back 3 commits. You *will* lose uncommitted work.
git checkout existingbranch
@htuscher
htuscher / FeatureContext.php
Created September 11, 2013 15:46
FeatureContext using Mink for TYPO3 Backend automation
<?php
use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Context\BehatContext,
Behat\Behat\Context\Step,
Behat\Behat\Exception\PendingException,
Behat\Behat\Event\ScenarioEvent;
use Behat\Gherkin\Node\PyStringNode,
@htuscher
htuscher / indexing_image
Created October 30, 2013 15:01
TYPO3 Solr Indexing prerender image
image_stringS = IMG_RESOURCE
image_stringS{
file{
width = 100
import = uploads/media/
import{
field = media
listNum = 0
}
}
<?php
/**
* Copyright notice
*
* (c) typovision GmbH, www.typovision.de
*
* @author Hans Höchtl <hans.hoechtl@typovision.de>
*
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/

Keybase proof

I hereby claim:

  • I am hhoechtl on github.
  • I am hhoechtl (https://keybase.io/hhoechtl) on keybase.
  • I have a public key whose fingerprint is 9EA4 C420 CADC 74D2 E618 303B 00B5 463C 906F CB33

To claim this, I am signing this object:

@htuscher
htuscher / strace_apache_open_files.sh
Created April 7, 2014 09:36
Use strace to show files opened by all apache processes
#!/bin/bash
ps auxw | grep sbin/apache | awk '{print"-p " $2}' | xargs strace -e open
@htuscher
htuscher / MyRepository.php
Last active February 26, 2018 11:56
TYPO3 Extbase 6.2 debug generated query
<?php
namespace Vendor\Ext\Domain\Repository
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
use TYPO3\CMS\Extbase\Persistence\Repository;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
<?php
namespace Vendor\Extension\Domain\Repository;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
class MyRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
/**