Skip to content

Instantly share code, notes, and snippets.

View tmotyl's full-sized avatar

Tymoteusz Motylewski tmotyl

View GitHub Profile
@tmotyl
tmotyl / RTE iframe
Created June 10, 2020 07:49
ckeditor iframe TYPO3
editor:
config:
extraAllowedContent:
- "iframe(*){*}[*]"
allowTags:
- iframe
processing:
allowTags:
- iframe
allowTagsOutside:
@tmotyl
tmotyl / composer_json_generator.php
Last active March 21, 2020 20:46
generate composer.json from modman
<?php
$folderToScan = '.modman/3rdParty';
$directories = scandir($folderToScan);
foreach ($directories as $directory) {
if ($directory === '.' || $directory === '..' || $directory === '3rdParty') {
continue;
}
if (!file_exists($folderToScan . '/' . $directory . '/modman')
|| file_exists($folderToScan . '/' . $directory . '/composer.json')
<?php
$data = array(
'AddThis_SharingTool_Block_Share' => 'app/code/community/AddThis/SharingTool/Block/Share.php',
'AddThis_SharingTool_Model_Observer' => 'app/code/community/AddThis/SharingTool/Model/Observer.php',
'Amasty_Base_Model_Feed' => 'app/code/local/Amasty/Base/Model/Feed.php',
'Amasty_Promo_Helper_Data' => 'app/code/local/Amasty/Promo/Helper/Data.php',
'Amasty_Promo_Model_Observer' => 'app/code/local/Amasty/Promo/Model/Observer.php',
'Amasty_Rules_Block_Adminhtml_Promo_Quote_Edit' => 'app/code/local/Amasty/Rules/Block/Adminhtml/Promo/Quote/Edit.php',
'Amasty_Rules_Block_Checkout_Discount' => 'app/code/local/Amasty/Rules/Block/Checkout/Discount.php',
php -v
PHP 7.2.7-0ubuntu0.18.04.2
Opcache cli enabled:
php test.php
JSON serializing: 4.27
2339.52req/s
content size: 141230
JSON unserializing: 7.39
1352.93req/s
Native serializing: 0.59
@tmotyl
tmotyl / docker-compose.hosts.yaml
Last active June 13, 2018 14:21
TYPO3 Solr DDEV docker image
#this makes local domain being available for crawling from within docker web container
#see https://github.com/drud/ddev/issues/842
version: '3'
services:
web:
extra_hosts:
- "${DDEV_SITENAME}.ddev.local:127.0.0.1"
@tmotyl
tmotyl / addNewColumnToDataset.php
Last active December 1, 2016 22:50
Add new column to TYPO3 functional tests CSV dataset
<?php
/**
* @cli
*/
public function addl18noriguidToDatasetsCommand()
{
$column = 'l10n_origuid';
$startPath = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/';
$absStartPath = PATH_site . $startPath;
$Directory = new \RecursiveDirectoryIterator($absStartPath);
@tmotyl
tmotyl / integrity checks
Last active November 22, 2016 12:32
TYPO3 database integrity check
1. t3_origuid should not be equal to uid of the record
- potential fix - if a record has l10n_parent set, set t3_origuid set to the value of l0n_parent
2. l10n_parent should contain uid of record in default language only
3. // pid != pid parent
//uid == l10n_parent
//record in default language having l18n set
live records with t3ver_oid set ?
@tmotyl
tmotyl / 0_reuse_code.js
Created July 14, 2016 16:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tmotyl
tmotyl / gist:d2c26fcc2f3776f99b68
Last active August 29, 2015 14:23
Magento EAV health check
#Check if product eav tables contain values only for product entity_type_id =10 (no results == OK)
SELECT 'catalog_product_entity_datetime', entity_type_id, attribute_id, value FROM catalog_product_entity_datetime
where entity_type_id <> 10
union SELECT 'catalog_product_entity_decimal', entity_type_id, attribute_id, value FROM catalog_product_entity_decimal
where entity_type_id <> 10
union SELECT 'catalog_product_entity_int', entity_type_id, attribute_id, value FROM catalog_product_entity_int
where entity_type_id <> 10
union SELECT 'catalog_product_entity_text', entity_type_id, attribute_id, value FROM catalog_product_entity_text
where entity_type_id <> 10

Paths

/var/www/site/ /var/www/site/app /var/www/site/web - webroot

Configuration and ports: