Skip to content

Instantly share code, notes, and snippets.

View Nolwennig's full-sized avatar
🐘
Focusing

Nolwennig Nolwennig

🐘
Focusing
View GitHub Profile
@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
@Nolwennig
Nolwennig / GetAllCatalogProductAttributes.php
Created October 13, 2017 12:36
[Magento2] Get all catalog_product attributes
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$attributeRepository = $objectManager->create('Magento\Eav\Api\AttributeRepositoryInterface');
$searchCriteriaBuilder = $objectManager->create('Magento\Framework\Api\SearchCriteriaBuilder');
$searchCriteria = $searchCriteriaBuilder->create();
$entityTypeCode = \Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE;
$attributes = $attributeRepository->getList($entityTypeCode,$searchCriteria);
foreach ($attributes->getItems() as $attribute) {
@Nolwennig
Nolwennig / functions.php
Last active January 24, 2018 12:32
front router wp
<?php
/** WP - Dirty Front Router */
add_action('send_headers', 'site_router');
function site_router(){
$root = str_replace('index.php', '', $_SERVER['SCRIPT_NAME']);
$url = str_replace($root, '', $_SERVER['REQUEST_URI']);
$url = explode('/', $url);
if(count($url){