Skip to content

Instantly share code, notes, and snippets.

{
"name": "rx-rover",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "babel-node test.js | faucet",
"test_debug": "babel-node test.js"
},
"author": "",
@real34
real34 / todo.eve.md
Last active December 13, 2016 23:23
Eve - Application "Autofocus"

Autofocus

Mon application

Ceci une application de TODO List pour remplacer le carnet qui me suit partout. Cette application sera utilisée en plusieurs phases : planification ou action.

Au lancement l'application est en mode planification.

commit
  [#app phase: "planification"]
@real34
real34 / plugins.php
Last active March 22, 2017 05:37
Magento2 plugin
<?php
function displayAndConvert($input) {
display($input);
return strtoupper($input);
}
// displayAndConvert('foo') -> display('foo') -> return 'FOO'
function beforeDisplayAndConvert($input) {
return $input . ' - With before';
}
/*
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Security-Policy: script-src 'self' https://apis.google.com
/css/main.css
Cache-Control: public max-age=31536000
/app.js
Cache-Control: public max-age=31536000

Voici comme promis les docs pour Magento 1 afin de comprendre les différentes parties.

TL;DR

Le site https://magentotherightway.com/ reprend de manière assez concise un gros ensemble de bonnes pratiques.

Je pense que à froid cela vous semblera cryptique, mais je vous invite à vous mettre un rappel (par exemple toutes les 2 semaines) pour relire rapidement les différentes sections.

@real34
real34 / FakeAddressRepository.php
Last active May 2, 2017 19:44
Magento2 Fakes implementation built step by step to support our tests. (Context: https://mobile.twitter.com/fschmengler/status/859473111984590848)
<?php
namespace Terrang\Fluxs\Test\Fake\Repository;
use Magento\Framework\Exception\NoSuchEntityException;
class FakeAddressRepository implements \Magento\Customer\Api\AddressRepositoryInterface
{
private $db = [];
@real34
real34 / front_commerce-magento_2_url.json
Created May 23, 2017 06:37
Pact specification for retrieving urls from a headless Magento2 (custom module)
{
"consumer": {
"name": "Front Commerce"
},
"provider": {
"name": "Magento 2 Url"
},
"interactions": [
{
"description": "A find request for entity with type category and id 6",
{
product(sku:"LOW-310589") {
name
imageUrl
giftMessageAvailable
sku
brand
terrangAdvice
isBuyableOnline
additionalInformation {