Skip to content

Instantly share code, notes, and snippets.

View jonatanaxe's full-sized avatar
🐓
console.log('wololo');

Jonatan Machado jonatanaxe

🐓
console.log('wololo');
View GitHub Profile
@antfu
antfu / git.sh
Created July 16, 2020 03:03
Git remove files from all history
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch example.js'
@lnoering
lnoering / m2-why-patch.md
Last active March 24, 2023 23:25
[Magento 2] - Patch

Utilizando patch no Magento 2.

SOBRE

Vantagens

  • Não irá aplicar caso o módulo de origem for atualizado e tiver alguma diferença de quando foi criado.
  • Não é necessário fazer reescrita de classe, deixando o processo de build mais complexo.
  • Caso o o módulo de origem passe a ter a correção/funcionalidade que foi criado com o patch, basta apenas ignorar ele.
  • Aplicamos N patch`s e conseguimos setar a ordem deles.
\!h Magento samples
https://github.com/magento/magento2-samples
\!h Simple controller
https://inchoo.net/magento-2/how-to-create-a-basic-module-in-magento-2/
https://edmondscommerce.github.io/magento-2-controller-output-types/
https://edmondscommerce.github.io/magento-2-controller-output-types/
\!h Payment method
@leek
leek / _Magento2_DeleteTestData.md
Last active March 27, 2025 06:52
Magento 2 - Delete All Test Data

These set of scripts are for Magento 2. For Magento 1, see this Gist.

@rafaelstz
rafaelstz / Magento2-API-OAuth-based_authentication.php
Last active September 8, 2023 06:15
Sample files to use Magento 2 REST and SOAP API. Using Token-based authentication and OAuth-based authentication method.
<?php
function sign($method, $url, $data, $consumerSecret, $tokenSecret)
{
$url = urlEncodeAsZend($url);
$data = urlEncodeAsZend(http_build_query($data, '', '&'));
$data = implode('&', [$method, $url, $data]);
$secret = implode('&', [$consumerSecret, $tokenSecret]);
@rafaelstz
rafaelstz / magento1-rest.php
Last active December 9, 2019 02:37
Magento 1 - Sample PHP script to connect via API REST
<?php
// Created by Rafael Corrêa Gomes
// Reference http://devdocs.magento.com/guides/m1x/api/rest/introduction.html#RESTAPIIntroduction-RESTResources
// Custom Resource
$apiResources = "products?limit=2";
// Custom Values
$isAdminUser = true;
$adminUrl = "admin";
@italoandre
italoandre / adding_attributes_magento_database.php
Created October 7, 2011 16:54
Adding customer and address atributtes to Magento's Database - Adicionando atributos de cliente e endereço ao banco de dados do Magento
<?php
/**
USAGE:
Paste this code inside any file called by Magento, like the app/design/frontend/package/theme/page/html/head.phtml and just acess your store. The code will run and after that it must be removed or commented. Be aware that not removing or commenting it will add these attributes to the database everytime code runs.
USO:
Cole este código dentro de qualquer arquivo chamado pelo Magento, como o app/design/frontend/package/theme/page/html/head.phtml e acesse sua loja. O código será executado e depois disso ele deve ser removido ou comentado. Esteja ciente de que não remover ou comentar o código irá adicionar estes atributos ao banco cada vez que for executado.