Skip to content

Instantly share code, notes, and snippets.

View infabo's full-sized avatar
🏠
Working from home

Ingo Fabbri infabo

🏠
Working from home
View GitHub Profile
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@Merec
Merec / PageLayoutView.php
Last active September 16, 2021 08:55 — forked from uberboom/PageLayoutView.php
TYPO3: Render a backend preview of custom content elements (TYPO3 CMS 6.2)
<?php
namespace Your\Extension\Namespace\Hooks;
class PageLayoutView implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface
{
/**
* Preprocesses the preview rendering of a content element.
*
@AydinHassan
AydinHassan / add-magento-version.php
Last active February 15, 2024 08:18
Add a new version of Magento to a repository compatible with https://github.com/AydinHassan/magento-core-composer-installer
<?php
/**
* Script to manage to version of Magento in a git mirror
* php $argv[0] core-repository new-version-of-magento
*
* It will look for Mage.php in new-version-of-magento and parse the version
* and edition from it.
*
* It will copy the code, remove the old files, create new branches if necessary
@mpchadwick
mpchadwick / Mpchadwick_Missing_Acl_Checker.php
Created July 11, 2015 03:42
Mpchadwick_Missing_Acl_Checker.php
<?php
require_once 'abstract.php';
/**
* Generate a CSV of modules with admin routes that haven't implemented _isAllowed()
*/
class Mpchadwick_Missing_Acl_Checker extends Mage_Shell_Abstract
{
const MODULES_PATH = 'modules';
@ursbraem
ursbraem / gist:f6b573724c9dad9724a0
Last active February 16, 2016 18:24
Tsconfig-all
options {
// enable upload fields in Element Browser
uploadFieldsInTopOfEB = 1
createFoldersInEB =1
//Add save-and-new to all forms
saveDocNew = 1
// better Page tree
pageTree {
showNavTitle = 1
showPageIdWithTitle = 1
@a-r-m-i-n
a-r-m-i-n / FluidTemplate.html
Last active July 30, 2020 14:02
How to render responsive images in fluid templates (dce example)
{namespace dce=ArminVieweg\Dce\ViewHelpers}
<f:layout name="Default" />
<f:section name="main">
<f:for each="{dce:fal(field:'images', contentObject:contentObject)}" as="image">
<!-- This is the normal unresponsive way -->
<f:image image="{image}" />
<!-- Here we referer to typoscript to render the responsive image -->
<f:cObject typoscriptObjectPath="lib.responsiveImage" data="{image.uid}"></f:cObject>
</f:for>
@avoelkl
avoelkl / gist:49563c516d6cb318eb34
Last active November 17, 2020 07:41
Non-blocking and quick database dumps for large databases

How-to

Add --single-transaction and --quick to your mysqldump command.

--single-transaction

sets the isolation mode to REPEATABLE READ and starts a transaction before dumping data. useful for InnoDB tables, dumps the consistent state without blocking any applications.

--quick

@colinmollenhour
colinmollenhour / Config.php
Last active April 22, 2020 09:45
Stampede-resistant Config Cache
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@tegansnyder
tegansnyder / opcache.ini
Last active September 2, 2022 16:24
OpCache settings for Magento on PHP 5.5.14. Store this file as /etc/php.d/opcache.ini
; Enable Zend OPcache extension module
zend_extension=opcache.so
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0
; The OPcache shared memory storage size.
@h3nn3s
h3nn3s / gist:d0c2015ff7fc4a7c438a
Created July 16, 2014 05:59
TYPO3 Gridelements with Flexform-Image
/*
* TypoScript
*/
# render headline
#tt_content.gridelements_pi1.10 = < lib.stdheader
tt_content.gridelements_pi1.20.10.setup {
1 < lib.gridelements.defaultGridSetup
1 {
columns {
1 < .default