Skip to content

Instantly share code, notes, and snippets.

@derhansen
derhansen / SwitchableControllerActionsPluginUpdater.php
Created March 20, 2021 11:23
SwitchableControllerActionsPluginUpdater for TYPO3 extension "Plain FAQ"
<?php
declare(strict_types=1);
/*
* This file is part of the Extension "plain_faq" for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/
@alexarje
alexarje / mxf2mp4.sh
Last active February 12, 2024 13:28
Convert MXF files to MP4 using FFmpeg
#!/bin/bash
# Script for converting MXF video files to different to other file formats.
for i in *.MXF; do
if [ -e "$i" ]; then
file=`basename "$i" .MXF`
# MP4 file with default settings + deinterlacing
ffmpeg -i "$i" -c:v libx264 -vf yadif "$file.mp4"
@joekolade
joekolade / DropzoneModifier.php
Last active March 3, 2023 11:09
[TYPO3 FE Edit] Enable frontend_editing with gridelements in TYPO3 CMS 8.7 #typo3 #typoscript
<?php
declare(strict_types=1);
namespace Vendor\Extension\Hooks;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\FrontendEditing\EditingPanel\FrontendEditingDropzoneModifier;
use TYPO3\CMS\FrontendEditing\Service\ContentEditableWrapperService;
/**
@barryvdh
barryvdh / pre-commit
Last active May 16, 2023 12:37
phpunit pre-commit git hook
#!/usr/bin/env php
<?php
echo "Running tests.. ";
exec('vendor/bin/phpunit', $output, $returnCode);
if ($returnCode !== 0) {
// Show full output
echo PHP_EOL . implode($output, PHP_EOL) . PHP_EOL;
echo "Aborting commit.." . PHP_EOL;
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active April 20, 2024 02:26
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active December 12, 2023 17:47
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@oliverthiele
oliverthiele / ModelController.php
Created July 22, 2014 20:33
Debugging errors like "An error occurred while trying to call Vendor\ExtKey\Controller\ModelController->showAction() " in extbase extensions
/**
* A special action which is called if the originally intended action could
* not be called, for example if the arguments were not valid.
*
* The default implementation sets a flash message, request errors and forwards back
* to the originating action. This is suitable for most actions dealing with form input.
*
* We clear the page cache by default on an error as well, as we need to make sure the
* data is re-evaluated when the user changes something.
*
@taldanzig
taldanzig / osxvpnrouting.markdown
Created January 24, 2013 22:14
Routing tips for VPNs on OS X

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

@niepi
niepi / osx_php_homebrew.setup.md
Created February 28, 2012 13:23
OSX PHP Homebrew Setup

install php

with mysql pgsql intl support

$ brew install php --with-apache --with-mysql --with-pgsql --with-intl

set php timezone in php ini

date.timezone = Europe/Vienna