Skip to content

Instantly share code, notes, and snippets.

@aamant
aamant / AddStaticAttributeMyCustomAttrPatch
Last active December 4, 2019 14:35
Simple Magento 2 attribute extension
<?php
/**
* AddStaticAttributeMyCustomAttrPatch
*
* @author Arnaud Amant <[email protected]>
*/
namespace Aamant\MyModule\Setup\Patch\Data;
use Magento\Customer\Model\Customer;
find /path/to/session -name sess_* -cmin +24 -exec rm {} \;
FastCgiExternalServer /fcgi-bin-php5-fpm-pma -socket /var/run/php5-fpm-pma.sock -idle-timeout 250 -pass-header Authorization
@aamant
aamant / gist:0a3f4ca83b62d2dfcececf88404d2d8d
Last active November 4, 2019 07:40
PhpStorm case sensitive
echo idea.case.sensitive.fs=true >> ~/Library/Preferences/PhpStorm2019.2/idea.properties

Install

Installation de bundle

gem install bundler

Installation des librairies (Capistrano 3, capistrano-symfony, ...).

@aamant
aamant / Token
Created March 9, 2016 14:58
Simple token generator
function generateToken()
{
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
mt_rand(0, 0xffff), mt_rand(0, 0xffff),
mt_rand(0, 0xffff),
mt_rand(0, 0x0fff) | 0x4000,
mt_rand(0, 0x3fff) | 0x8000,
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
);
}