This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class="products-grid-item"> | |
<img class="products-grid-item__image"> | |
<div class="products-grid-item__description">[..]</div> | |
<span class="products-grid-item__price">[..]</span> | |
<button class="button button - buy">[..]</button> | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.products-grid { | |
display: grid; | |
grid-gap: 15px; | |
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); // distribui os itens e já deixa a grade responsiva | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const submitForm = (form, callback = null) => { | |
// [..] | |
fetch(form.action, [..]) | |
.then(response => { | |
// [..] | |
if (callback) { | |
callback(response) // executa a função personalizada que varia pra cada form, passando a response pra ela | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const submitForm = form => { | |
// se quiser colocar um efeito de loading, ele vai aqui | |
const previousMessage = form.querySelector('.message') | |
if (previousMessage) { | |
form.removeChild(previousMessage) // remove a mensagem de algum submit anterior | |
} | |
const body = new FormData(form) // coloca os inputs/select/textarea do form numa variável | |
const method = form.method // pega o método do form (GET/POST) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form type="post" action="/customer/account/registerPost"> | |
<input type="hidde" name="csrf_key" value="123456"> | |
<label for="name">Nome:</label> | |
<input type="text" name="name" id="name"> | |
<label for="email">E-mail:</label> | |
<input type="text" name="email" id="email"> | |
<label for="message">Mensagem:</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$customers = []; | |
for ($count = 1; $count < 100000; $count++) { | |
$customers[] = [ | |
'id' => $count, | |
'name' => array_random(['Lorem', 'Ipsum', 'Dolor']), | |
]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mediaDir = Mage::getBaseDir('media'); | |
$varDir = Mage::getBaseDir('var'); | |
$backupDir = "$varDir/media_unused"; | |
if (!is_dir($backupDir)) { | |
mkdir($backupDir, 0770, true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
Mage::app()->getLocale()->emulate(1); | |
// loads the proper email template | |
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('eflips_new_order'); | |
// $emailTemplate = Mage::getModel('core/email_template')->loadDefault('sales_email_order_template'); | |
// $emailTemplate = Mage::getModel('core/email_template')->loadByCode('2 - Pedido Realizado (NOVO)'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"exclude": [ | |
".git/**", | |
"node_modules/**", | |
"bower_components/**" | |
], | |
"always-semicolon": true, | |
"block-indent": " ", | |
"color-case": "lower", | |
"color-shorthand": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initialization file (not found) |
NewerOlder