Skip to content

Instantly share code, notes, and snippets.

View Nolwennig's full-sized avatar
🐘
Focusing

Nolwennig Nolwennig

🐘
Focusing
View GitHub Profile
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Titre de la page</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
...
@Nolwennig
Nolwennig / Layout.php
Created April 24, 2018 07:37
magento2 layout logger
<?php
// app/code/LayoutLogger/PageXml/Model/Layout.php
namespace LayoutLogger\PageXml\Model;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
class Layout implements ObserverInterface {
protected $_logger;
@Nolwennig
Nolwennig / customer.xml
Last active April 16, 2018 15:07
Magento: SUPEE-6788 patch
<customer_account_changeforgotten translate="label">
<label>Reset a Password</label>
<remove name="right"/>
<remove name="left"/>
<reference name="head">
<action method="setTitle" translate="title" module="customer">
<title>Reset a Password</title>
</action>
</reference>
@Nolwennig
Nolwennig / functions.php
Last active March 10, 2018 00:46
Disable default WordPress REST Endpoints
<?php
add_filter('rest_endpoints',
function($endpoints) {
foreach ([
"/wp/v2",
"/wp/v2/posts",
"/wp/v2/posts/(?P<id>[\d]+)",
"/wp/v2/posts/(?P<parent>[\d]+)/revisions",
"/wp/v2/posts/(?P<parent>[\d]+)/revisions/(?P<id>[\d]+)",
@Nolwennig
Nolwennig / form_code.md
Created March 1, 2018 13:17
all Magento used_in_forms

mysql> SELECT DISTINCT(form_code) FROM customer_form_attribute;

+----------------------------+
| form_code                  |
+----------------------------+
| adminhtml_checkout         |
| adminhtml_customer         |
| adminhtml_customer_address |
| checkout_register          |

| customer_account_create |

@Nolwennig
Nolwennig / symfony3-rest-api.md
Created March 1, 2018 13:07 — forked from diegonobre/symfony3-rest-api.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authenticationu
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :

@Nolwennig
Nolwennig / docker-https.md
Created January 23, 2018 13:34 — forked from zalexki/docker-https.md
Docker Apache2.4 HTTPS

Open port 443 on container, with a docker-compose file just add :

ports:
  - 443:443

Add virtualhost config :

Listen 443 https
  
@Nolwennig
Nolwennig / Makefile
Last active December 11, 2018 10:16
make coffee ;-)
coffee:
bash coffee.sh
@Nolwennig
Nolwennig / Magento simpleCategoryTree.md
Last active December 8, 2020 13:30
Magento-{1.{7-9}|2} simpleCategoryTree sql request > .csv

Magento simpleCategoryTree.csv

command from cli

mysql -uroot -proot magento -e "here sql query" > category_tree.csv; 

sql query

@Nolwennig
Nolwennig / howto.md
Created November 12, 2017 00:12
merge video_part1.mp4 with video_part2.mp4