Skip to content

Instantly share code, notes, and snippets.

@hh-com
hh-com / getAllProductLinks.php
Last active November 18, 2018 20:19
Prestashop: Get all Product- Links
@hh-com
hh-com / Prestashop: AdminProductDataProvider.php
Last active June 30, 2018 09:08
Prestashop Product-List in Backend is very slow. Comment out the image query to solves the problem for me. /src/Adapter/Product/AdminProductDataProvider.php Line:212 and 252 to 261
<?php
/**
* 2007-2017 PrestaShop
*
* 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:
* https://opensource.org/licenses/OSL-3.0
@hh-com
hh-com / analytics_google.html
Created February 23, 2018 09:22
Activate / Deactivate BUTTON for Contao Google Analytics Template
<?php
/**
* To use this script, please fill in your Google Analytics ID below
*/
$GoogleAnalyticsId = 'UA-XXXXX-X';
/**
* DO NOT EDIT ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!
@hh-com
hh-com / generateAlias.php
Last active November 21, 2017 18:02
PHP Function to generate an Alias for URL
<?php
public function generateAlias($strString, $uniquer)
{
$strString = preg_replace('/(&#*\w+)[\x00-\x20]+;/i', '$1;', $strString);
$strString = preg_replace('/(&#x*)([0-9a-f]+);/i', '$1$2;', $strString);
$strString = html_entity_decode($strString, ENT_COMPAT, null);
$strString = str_replace(array('[&]', '[&amp;]', '[lt]', '[gt]', '[nbsp]', '[-]'), array('&amp;', '&amp;', '&lt;', '&gt;', '&nbsp;', '&shy;'), $strString);
$arrSearch = array('/[^a-zA-Z0-9 \.\&\/_-]+/', '/[ \.\&\/-]+/');
$arrReplace = array('', '-');
@hh-com
hh-com / Create Image from PDF with Imagick.php
Last active November 17, 2017 11:14
Create Images from each page in a PDF-File with Imagick
<?php
function pdf2Png($pdfPath, $imgPath = ".")
{
$path_parts = pathinfo($pdfPath);
$PdfFilename = "pdf".$path_parts['filename'];
$pdf = new \Imagick($pdfPath);
$anzahlDerSeiten = $pdf->getNumberImages();
<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/afl-3.0.php
<?php
/*
* 2007-2015 PrestaShop
*
* 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