Skip to content

Instantly share code, notes, and snippets.

🎉

Paul Hachmang paales

🎉
View GitHub Profile
View coroutine.php
<?php
class DataProvider
{
public function execute(): \Generator
{
while(true) {
$requests = yield;
foreach ($requests as $request) {
yield $request . ' - appended';
View responsive-size.less
//
// 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:
//
@paales
paales / HelperTranslate.php
Last active Aug 29, 2015
Add translations automatically to your module's CSV.
View HelperTranslate.php
<?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());
@paales
paales / n98-magerun.yaml
Last active Jul 30, 2018
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
View n98-magerun.yaml
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_*
View patch_commit_47d2f7d5db88.patch
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())) {
View [+FEAT] Improved error printing.patch
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);
View [+BUGIX] Firefox doesn’t allow cross-domain fonts.patch
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 / gist:6682242
Last active Dec 22, 2018
rsync a Magento installation
View gist:6682242
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
You can’t perform that action at this time.