Skip to content

Instantly share code, notes, and snippets.

View dmitryd's full-sized avatar

Dmitry Dulepov dmitryd

View GitHub Profile
@dmitryd
dmitryd / validate-yaml.txt
Last active February 8, 2022 10:15
Validate YAML file using Python one-liner
python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < file.yml
Needs "pip install pyyaml".
Source: https://liquidat.wordpress.com/2016/01/21/short-tip-verify-yaml-in-shell-via-python-one-liner/
@dmitryd
dmitryd / Library_LaunchDaemons_com.noatime.root.plist
Created June 29, 2015 14:38
"noatime" for OS X on SSD. Place this file to /Library/LaunchDaemons/com.noatime.root.plist and do `sudo launchctl load -w /Library/LaunchDaemons/com.noatime.root.plist`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.noatime.root</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/mount</string>
<string>-vuwo</string>
@dmitryd
dmitryd / docker-compose.solr.yaml
Last active March 27, 2021 11:33
Ddev yaml file for using solr in TYPO3
# To access Solr after it is installed:
# - The Solr admin interface will be accessible at:
# http://<projectname>.ddev.site:8983/solr/
# For example, if the project is named "myproject" the hostname will be:
# http://myproject.ddev.site:8983/solr/
# - To access the Solr container from the web container use:
# http://solr:8983/solr/
version: '3.6'
@dmitryd
dmitryd / normalizer.diff
Created March 27, 2021 09:40
TYPO3 9.5 patch for #93764: slugs in non-normalized Unicode can produce incorrect urls
commit 0657788b1e5e0b5ea382083637438fc50c22baf8
Author: Dmitry Dulepov <ddulepov@snowflake.ch>
Date: Wed Mar 17 13:47:07 2021 +0300
[BUGFIX] Slugs in non-normalized Unicode can produce incorrect urls
diff --git a/typo3/sysext/core/Classes/DataHandling/SlugHelper.php b/typo3/sysext/core/Classes/DataHandling/SlugHelper.php
index dccc65af7f..fb4e8ca46e 100644
--- a/typo3/sysext/core/Classes/DataHandling/SlugHelper.php
+++ b/typo3/sysext/core/Classes/DataHandling/SlugHelper.php
@dmitryd
dmitryd / ContentButtonBarHook.php
Created August 17, 2020 14:42
Restore split button for TYPO3 v9 forms
<?php
namespace Vendor\Extension\Hook;
use TYPO3\CMS\Backend\Template\Components\ButtonBar;
use TYPO3\CMS\Backend\Template\Components\Buttons\InputButton;
use TYPO3\CMS\Backend\Template\Components\Buttons\LinkButton;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
@dmitryd
dmitryd / replace.sh
Created August 11, 2019 08:34
Replace git email in all subdirectories
#!/usr/bin/env bash
for f in `grep -Rl --include=config 'my.email@example.com' .` ; do sed -i 's/my.email@example.com/my.new.email@example.com/' "$f" ; done
<?php
namespace Vendor\Extension\Storage;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface;
use TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser;
/**
* This class allows ordering by 'FIELD' SQL statement.
*
* @author Dmitry Dulepov <dmitry.dulepov@gmail.com>
@dmitryd
dmitryd / composer-toggle-swap.sh
Created December 14, 2018 09:06
Toggles swap for the composer on Linux
#/bin/bash
# Must be run as root!
# Source: https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors
if [ -f /var/swap.1 ] ; then
/sbin/swapoff /var/swap.1
rm /var/swap.1
echo "Swap is off"
else
@dmitryd
dmitryd / Typo3DbQueryParser.php
Last active September 7, 2017 07:35
Fix issue with incorrect localization handling in Extbase (missing support for l10n_mode=exclude, which makes some relations missing). See http://bit.ly/1Djw1CV
<?php
namespace DmitryDulepov\Sample\Xclass;
class Typo3DbQueryParser extends \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser {
/**
* Fixes incorrect localisation handling in Extbase.
*
* @param string $tableName
* @param array $sql
@dmitryd
dmitryd / Classes_Controller_MyController.php
Last active August 30, 2017 15:15
TYPO3 Extbase and "Insert records"
<?php
namespace DmitryDulepov\Myext\Controller;
class MyController {
/**
* @var \DmitryDulepov\Myext\\Domain\Repository\RecordRepository
* @inject
*/
protected $recordRepository;