Skip to content

Instantly share code, notes, and snippets.

{
"vars": {
"@gray-base": "#555555",
"@gray-darker": "#222222",
"@gray-dark": "#333333",
"@gray": "#555555",
"@gray-light": "#eeeeee",
"@gray-lighter": "#999999",
"@brand-primary": "#9db326",
"@brand-success": "#0062ac",
<?php
$name = filter_input(INPUT_GET, 'name', FILTER_SANITIZE_STRING);
$title = filter_input(INPUT_GET, 'title', FILTER_SANITIZE_STRING);
echo $name;
if (!$title || $title ==''){
$title = 'Voici Un Putain de Titre Super Vendeur !';
}
echo $title;
@julienanquetil
julienanquetil / gist:00f6e5947cde8f96dcf0557f562b7529
Created September 5, 2017 12:53
PIMGento-2/Product/Model/Factory/Import.php
<?php
namespace Pimgento\Product\Model\Factory;
use \Pimgento\Import\Model\Factory;
use \Pimgento\Entities\Model\Entities;
use \Pimgento\Import\Helper\Config as helperConfig;
use \Pimgento\Import\Helper\UrlRewrite as urlRewriteHelper;
use \Pimgento\Product\Helper\Config as productHelper;
use \Pimgento\Product\Helper\Media as mediaHelper;
@julienanquetil
julienanquetil / csv1.csv
Created August 30, 2018 07:18
Merge csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
sku;col1;col2;test
123;456;99;A
234;786;99;
345;678;99;A
@julienanquetil
julienanquetil / Magento_composer.json
Created February 18, 2019 07:52
composer add custom module to magento2
{
"name": "magento/magento2ce",
"description": "Magento 2 My project",
"type": "project",
"version": "2.2.7",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
var url = document.querySelector("html>body>script").text.match(/https:\/\/vod-progressive.akamaized.net[\S]+?\.mp4[\S]+?\.mp4+/g)[0];
window.open(url);
@julienanquetil
julienanquetil / Media Entity
Created February 25, 2021 12:24
EasyAdmin Crud
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity
* @ORM\Table(name="medias")
@julienanquetil
julienanquetil / gist:7591c7a657ab33b1abf72c542cb14c1d
Created September 5, 2017 19:10
Magento 2 API add Video to product.
<?php
$adminUrl='http://magento2.dev/rest/V1/integration/admin/token';
$ch = curl_init();
$data = array("username" => "admin", "password" => "admin123");
$data_string = json_encode($data);
$ch = curl_init($adminUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);