Skip to content

Instantly share code, notes, and snippets.

View WENKz's full-sized avatar

Quentin Grisard WENKz

View GitHub Profile
@WENKz
WENKz / passwordRegex
Created March 4, 2021 09:45
password regex
public const PASSWORD_VALIDATION_REGEX = '/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-z\d\n]).{8,}$/';
@WENKz
WENKz / nfs-mounter.sh
Created January 29, 2020 08:13
NFS volumes mounter for docker-for-mac
#!/usr/bin/env bash
OS=`uname -s`
if [ $OS != "Darwin" ]; then
echo "This script is OSX-only. Please do not run it on any other Unix."
exit 1
fi
if [[ $EUID -eq 0 ]]; then
@WENKz
WENKz / Prestashop to Magento2 product export
Last active December 13, 2018 12:39 — forked from ajankuv/Prestashop to Magento2 product export
Export prestashop 1.6 products for magento 2 import
select ps_product.reference AS 'sku', ps_product.active AS 'product_online', ps_product.price, ps_product.weight, ps_product.date_add AS 'created_at',
CONCAT('/img/p/',
IF(CHAR_LENGTH(pi.id_image) >= 5,
CONCAT(
SUBSTRING(pi.id_image, -5, 1),
'/'),
''),
IF(CHAR_LENGTH(pi.id_image) >= 4, CONCAT(SUBSTRING(pi.id_image, -4, 1), '/'), ''),
IF(CHAR_LENGTH(pi.id_image) >= 3, CONCAT(SUBSTRING(pi.id_image, -3, 1), '/'), ''),
if(CHAR_LENGTH(pi.id_image) >= 2, CONCAT(SUBSTRING(pi.id_image, -2, 1), '/'), ''),
@WENKz
WENKz / owebiagene.php
Created September 26, 2018 14:39
generate owebia Json from csv file
<?php
function calc($nb){
return number_format($nb*1.2,2);
}
$JSON = [];
if (($handle = fopen("owebia.csv", "r")) !== false) {
@WENKz
WENKz / admin_quote.php
Created June 16, 2017 09:31
magento get current admin quote
Mage::getSingleton('adminhtml/session_quote')->getQuote()->getentity_id()
@WENKz
WENKz / redmine path files upload
Created October 4, 2016 07:47
redmine path files upload
/var/lib/redmine/default/files
@WENKz
WENKz / export_order_item.php
Created September 30, 2016 09:45
export order item magento
<?php
ini_set('memory_limit', '2548M');
set_time_limit(0);
error_reporting(E_ALL | E_STRICT);
define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
ini_set('display_errors', 1);
define('STORE_ID', 3);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
@WENKz
WENKz / superAttributeOptionForConfigurableItem.php
Created August 9, 2016 14:27
get super attribute otpion value from configurable Magento
<?php
ini_set('memory_limit', '2048M');
error_reporting(E_ALL | E_STRICT);
define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_erors', 1);
Mage::app()->setCurrentStore(3);
@WENKz
WENKz / special_price.csv
Last active June 22, 2016 07:33
solde ! set special_price and from to (magento)
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2. in line 1.
sku;special_price;special_from_date;special_to_date
BALA-0007;14,9;2016-06-22;2016-08-02
@WENKz
WENKz / product_redirection_permanent.php
Created May 31, 2016 13:24
product_redirection_permanent
<?php
error_reporting(E_ALL | E_STRICT);
define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
ini_set('display_errors', 1);
define('STORE_ID', 3);
Mage::app()->setCurrentStore(3);