Skip to content

Instantly share code, notes, and snippets.

View igorhasse's full-sized avatar

Igor Hasse Santiago igorhasse

View GitHub Profile
@igorhasse
igorhasse / criar_dump.md
Created May 2, 2017 18:45 — forked from cagartner/criar_dump.md
Criar dump mysql externo

Criar dump:

mysqldump -u <user> -p -h <server.domain.com> <bd> > dumps/dump.sql --single-transaction

Exportar Dump:

mysql -u <user> -p -v -h <server.domain.com> <bd> < dumps/dump.sql

Documentação:

: usuário do banco -h: define que o servidor é externo : Link do servidor

@igorhasse
igorhasse / magento2-bloco-estatico.phtml
Created May 11, 2017 22:56 — forked from cagartner/magento2-bloco-estatico.phtml
Magento 2 como adicionar bloco estático
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('bloco_id')->toHtml();?>
@igorhasse
igorhasse / default.xml
Created May 12, 2017 19:09
Defualt.xml Magento 2 theme Folk
<?xml version="1.0"?>
<!--
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="default_head_blocks"/>
@igorhasse
igorhasse / requirejs-config.js
Last active August 14, 2017 21:07
Adicionando Require Js dentro de módulo m2
var config = {
map: {
'*': {
mask: 'Company_NameModule/js/mask',
}
},
};
@igorhasse
igorhasse / Observer.php
Created August 14, 2017 21:06
How to remove review step in checkout
public function saveOrder($observer)
{
/** @var $controllerAction Mage_Checkout_OnepageController */
$controllerAction = $observer->getEvent()->getControllerAction();
/** @var $response Mage_Core_Controller_Response_Http */
$response = $controllerAction->getResponse();
/**
* jsonDecode is used because the response of the XHR calls of onepage checkout is always formatted as a json
* string. jesonEncode is used after the response is manipulated.
@igorhasse
igorhasse / valdation-date.js
Created August 28, 2017 21:13
Validation Valid Date
// Expect input as d/m/y
function isValidDate(s) {
var bits = s.split('/');
var d = new Date(bits[2], bits[1] - 1, bits[0]);
return d && (d.getMonth() + 1) == bits[1];
}
['0/10/2017','29/2/2016'].forEach(function(s) {
console.log(s + ' : ' + isValidDate(s))
})
@igorhasse
igorhasse / gist:2ee01ed1fd50ae52555051fae9dc06ae
Created September 22, 2017 14:08
Url segura dinamicamente no Magento
array('_secure' => $this->getRequest()->isSecure())
@igorhasse
igorhasse / magento-front-compile.bash
Last active January 16, 2018 16:15 — forked from cagartner/magento-front-compile.bash
comando para compilar thema lessa para css
# Compila less
sudo chmod -R 777 . && sudo php bin/magento cache:flush && sudo rm -rf var/* && sudo php bin/magento dev:source-theme:deploy --locale=pt_BR --theme=CleverSoft/ione
# Limpa estatico
sudo chmod -R 777 . && sudo php bin/magento cache:flush && sudo rm -rf var/* && sudo php bin/magento setup:static-content:deploy pt_BR && sudo php bin/magento dev:source-theme:deploy --locale=pt_BR
@igorhasse
igorhasse / gist:18c7e3fd5341c402841e2533a7422954
Created November 17, 2017 13:13
Validações Padrões Magento, formulários
http://inchoo.net/magento/out-of-the-box-form-validation-in-magento/