Skip to content

Instantly share code, notes, and snippets.

View paales's full-sized avatar
💭
🎉

Paul Hachmang paales

💭
🎉
View GitHub Profile
@paales
paales / gist:6682242
Last active December 22, 2018 17:03
rsync a Magento installation
rsync -chavzP --exclude='path/to/installation/var/cache' --exclude='path/to/installation/.git' --exclude='path/to/installation/media/catalog/product/cache' --exclude='path/to/installation/var/tmp' --exclude='path/to/installation/var/session' --exclude='kiboots/var/report' --stats username@host:path/to/installation /destination/path
@paales
paales / n98-magerun.yaml
Last active July 30, 2018 19:35
Export a Magento database without the products or without the categories, place this file in app/etc/. Docs about creating a custom dump command: https://github.com/netz98/n98-magerun/wiki/Stripped-Database-Dumps
commands:
N98\Magento\Command\Database\DumpCommand:
table-groups:
- id: products
description: Skip all product tables.
tables: >
catalog_category_product*
catalog_compare_item
catalog_product_*
cataloginventory_stock_*
<?php
class DataProvider
{
public function execute(): \Generator
{
while(true) {
$requests = yield;
foreach ($requests as $request) {
yield $request . ' - appended';
diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
index 6c815ed68827dded619ecac227eda53ec860abf6..aa8e7d3812d7179fc254b47cbacbf89295a8a3f0 100644
--- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
+++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
@@ -278,13 +278,17 @@ abstract class Mage_ImportExport_Model_Import_Entity_Abstract
$this->_dataSourceModel->cleanBunches();
while ($source->valid() || $bunchRows) {
+ //if the row scope isn't default we aren't finished with this entity
+ if ($startNewBunch && $source->valid() && !$this->_isRowScopeDefault($source->current())) {
@paales
paales / responsive-size.less
Created July 5, 2016 09:31
Responsive sizing
//
// Responsive Size
// ---------------------------------------------
// Responsive size mixin, dynamic sizes based on viewport size, implemented with calc()
// Optional fallback implemented for some unsupported browsers, average of small/large
// http://caniuse.com/#search=viewport
// Usage:
//
diff --git a/app/Mage.php b/app/Mage.php
index 3dafad03a4a49d429354cbffb953c1cd04e384ac..47afd6b15daa2df1aac7a3bf257d1c6bc269a06f 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -895,7 +895,7 @@ final class Mage
}
print $e->getMessage() . "\n\n";
- print $e->getTraceAsString();
+ print getExceptionTraceAsString($e);
diff --git a/.htaccess b/.htaccess
index 60e17952c880bbd2b4ef4f7f63659624a9edb735..980a86b7107e1ce6aa2875c0126f4eab148d2bfd 100644
--- a/.htaccess
+++ b/.htaccess
@@ -207,3 +207,13 @@
## http://developer.yahoo.com/performance/rules.html#etags
#FileETag none
+
+
@paales
paales / HelperTranslate.php
Last active August 29, 2015 14:09
Add translations automatically to your module's CSV.
<?php
class Ho_SimpleBundle_Helper_Data extends Mage_Core_Helper_Abstract
{
public function __()
{
$args = func_get_args();
$string = array_shift($args);
$expr = new Mage_Core_Model_Translate_Expr($string, $this->_getModuleName());