Skip to content

Instantly share code, notes, and snippets.

OS Information: Linux Seeker 5.10.43.3-microsoft-standard-WSL2 #1 SMP Wed Jun 16 23:47:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
DDEV-Local version v1.18.0-alpha1
architecture amd64
db drud/ddev-dbserver-mariadb-10.3:20210709_mariadb_versions
dba phpmyadmin:5
ddev-ssh-agent drud/ddev-ssh-agent:v1.17.0
docker 20.10.7
docker-compose 1.29.2
mutagen 0.12.0-beta4
os linux
@susannemoog
susannemoog / use-native-symlinks.bat
Last active April 25, 2019 10:50 — forked from ohader/use-native-symlinks.bat
Use native symlinks (junction) on Windows host systems (scope: Docker/DDEV environment using TYPO3 & Composer)
@susannemoog
susannemoog / AcceptLanguageResolver.php
Created January 26, 2019 09:37
Change TYPO3 frontend language depending on accept-language browser setting
<?php
declare(strict_types=1);
namespace Psychomieze\Examples;
use Negotiation\AcceptLanguage;
use Negotiation\LanguageNegotiator;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
@susannemoog
susannemoog / ArrayClassMetaData.php
Last active April 28, 2018 13:34
TCA validation with Symfony Validator
<?php
declare(strict_types=1);
use Symfony\Component\Validator\Constraint;
class ArrayClassMetaData extends \Symfony\Component\Validator\Mapping\ClassMetadata
{
public function __construct(string $name)
{
@susannemoog
susannemoog / log.sh
Created April 4, 2018 11:07
Access.log parsing (URL, status code, errors...)
# per URL
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' | sed 's/\?.*//g' | sort | uniq -c | sort -rn
# per Status Code
cat access.log | cut -d '"' -f3 | cut -d ' ' -f2 | sort | uniq -c | sort -rn
# find URLs with status code (404)
awk '($9 ~ /404/)' access.log | awk '{print $7}' | sort | uniq -c | sort -rn
@susannemoog
susannemoog / t3_dbo_backend_layout.sql
Created March 29, 2018 09:43
TYPO3 sqlserver table definitions (v9-2-dev)
CREATE TABLE t3.dbo.backend_layout
(
uid int PRIMARY KEY NOT NULL IDENTITY,
pid int DEFAULT 0 NOT NULL,
t3ver_oid int DEFAULT 0 NOT NULL,
t3ver_id int DEFAULT 0 NOT NULL,
t3ver_wsid int DEFAULT 0 NOT NULL,
t3ver_label nvarchar(255) DEFAULT '' NOT NULL,
t3ver_state smallint DEFAULT 0 NOT NULL,
t3ver_stage int DEFAULT 0 NOT NULL,
@susannemoog
susannemoog / gist:4a9d98d67be57d264613a16813b6778d
Last active October 19, 2016 06:03
performance for beginsWith
Test:
100.000 random strings in words array:
foreach($words as $word) {
StringUtility::beginsWith($word, 'abc');
}
$time = microtime(true) - $now;
echo $time * 100 . ' | mem:' . memory_get_usage() . ' | peak mem:' . memory_get_peak_usage();
@susannemoog
susannemoog / Foo.php
Created March 30, 2016 15:50
php 7 casting tests
<?php
class Foo
{
public function intHint(int $baz)
{
return $baz;
}
@susannemoog
susannemoog / composer.json
Created August 14, 2014 09:03
Example composer.json
{
"repositories": [
{
"type": "composer",
"url": "http://composer.typo3.org/"
}
],
"require": {
"typo3/cms": "~6.2",
"typo3-ter/news": "*",
@susannemoog
susannemoog / gist:dfd4a04865c890360c8a
Created August 14, 2014 06:20
Example Vagrant TYPO3
apache:
install: '1'
settings:
user: www-data
group: www-data
default_vhost: true
manage_user: false
manage_group: false
sendfile: 0
modules: