Skip to content

Instantly share code, notes, and snippets.

Avatar

Tymoteusz Motylewski tmotyl

View GitHub Profile
@tmotyl
tmotyl / RTE iframe
Created Jun 10, 2020
ckeditor iframe TYPO3
View RTE iframe
editor:
config:
extraAllowedContent:
- "iframe(*){*}[*]"
allowTags:
- iframe
processing:
allowTags:
- iframe
allowTagsOutside:
@tmotyl
tmotyl / composer_json_generator.php
Last active Mar 21, 2020
generate composer.json from modman
View composer_json_generator.php
<?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')
View gist:dccadfd99d80d3c9b02726292598eda5
<?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',
View gist:68a3c61e86e595e6f540881ac7c71de3
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 Jun 13, 2018
TYPO3 Solr DDEV docker image
View docker-compose.hosts.yaml
#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 Dec 1, 2016
Add new column to TYPO3 functional tests CSV dataset
View addNewColumnToDataset.php
<?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 Nov 22, 2016
TYPO3 database integrity check
View integrity checks
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 Jul 14, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// 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 Aug 29, 2015
Magento EAV health check
View gist:d2c26fcc2f3776f99b68
#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
View gist:cdc27072b7607eefc0a0

Paths

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

Configuration and ports: