Skip to content

Instantly share code, notes, and snippets.

View molotovbliss's full-sized avatar
⚗️
Code, Eat, Sleep++;

Jared molotovbliss

⚗️
Code, Eat, Sleep++;
  • DFW, Texas
View GitHub Profile
@molotovbliss
molotovbliss / gist:2562551
Last active September 7, 2022 20:18 — forked from davidalexander/gist:1086455
Magento Snippets

Magento Snippets

Set all categories to is_anchor 1

Find attribute_id

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

Update all of them with anchor_id from above (usually is ID 51)

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51
@molotovbliss
molotovbliss / gist:2766535
Created May 22, 2012 04:22
Fix for Fooman GoogleAnalytics Plus not working in 1.7 CE, 1.11 EE.
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- 991
+++ 992
@@ -62,7 +62,8 @@
$success = false;
}
- if (version_compare(Mage::getVersion(), '1.4.1.1') > 0 && version_compare(Mage::getVersion(), '1.7.0.0') < 0) {
+ // Fix for invalid version detection as well as forward compatibility
@molotovbliss
molotovbliss / Magento Ignore Tables list EE
Created August 8, 2012 15:11
List of tables to possibly ignore upon integration points
core_cache, core_cache_tag, core_session, cron_schedule, customer_address_entity, customer_address_entity_datetime, customer_address_entity_decimal, customer_address_entity_int, customer_address_entity_text, customer_address_entity_varchar, customer_entity, customer_entity_datetime, customer_entity_decimal, customer_entity_int, customer_entity_text, customer_entity_varchar, dataflow_batch, dataflow_batch_export, dataflow_batch_import, dataflow_import_data, dataflow_profile_history, dataflow_profile_history, dataflow_session, dataintercept_api_debug, enterprise_customerbalance, enterprise_customerbalance_history, enterprise_customersegment_customer, enterprise_customersegment_event, enterprise_customersegment_segment, enterprise_customersegment_website, enterprise_customer_sales_flat_order, enterprise_customer_sales_flat_order_address, enterprise_customer_sales_flat_quote, enterprise_customer_sales_flat_quote_address, enterprise_giftcardaccount, enterprise_giftcardaccount_history, enterprise_giftcardaccount_po
@molotovbliss
molotovbliss / gist:7253347
Created October 31, 2013 17:09
Inline Renderer with onBlur JS Handler for ATWIX Inline Grid Editing.
// http://www.atwix.com/magento/inline-editing-in-magento-backend-grids/
public function render(Varien_Object $row)
{
$html = '<input type="text" ';
$html .= 'name="' . $this->getColumn()->getId() . '" ';
$html .= 'value="' . $row->getData($this->getColumn()->getIndex()) . '"';
$html .= 'class="validate-number input-text ' . $this->getColumn()->getInlineCss() . '" onblur="updateField(this, '. $row->getId() .'); return false"/>';
//$html .= '<button onclick="updateField(this, '. $row->getId() .'); return false">' . Mage::helper('deals')->__('Update') . '</button>';
return $html;
@molotovbliss
molotovbliss / gist:7572997
Created November 20, 2013 23:18
Magento Upgrade EE: When using shell/url_migration_to_1_13.php this greatly increased the completion time by 4x-5x.
ALTER TABLE `enterprise_url_rewrite_redirect`
ADD INDEX `redirect_id` (`redirect_id`) ;
ALTER TABLE `enterprise_url_rewrite`
ADD INDEX `request_path` (`request_path`) ;
@molotovbliss
molotovbliss / gist:8865428
Created February 7, 2014 15:53
wget crawler
Open 3 crawlers recursive, 4 levels deep and only crawl sites with domain thesite.com
wget -r -l4 –spider -D thesite.com http://www.thesite.com &
wget -r -l4 –spider -D thesite.com http://www.thesite.com &
wget -r -l4 –spider -D thesite.com http://www.thesite.com
Alternative to wget: http://aria2.sourceforge.net/
@molotovbliss
molotovbliss / gist:8866859
Last active November 16, 2016 02:32
MySQL Dump for Magento without locking the DB
mysqldump -u<USERNAME> -p<PASSWORD> --skip-opt --triggers --single-transaction --max_allowed_packet=512M db > db.sql
<?php
/**
* This script outputs an array of file hashes recursively for the current directory.
* Useful for generating hashlist for security scanning programs
*
*/
function recursive_md5($dir, $types = null, $recursive = true, $baseDir = '')
{
$to_ignore = array(
'.',
@molotovbliss
molotovbliss / space-invader-css
Last active August 29, 2015 13:56
Spaceinvader CSS
#space-invader{
box-shadow:
0 0 0 1em green,
0 1em 0 1em green,
-2.5em 1.5em 0 .5em green,
2.5em 1.5em 0 .5em green,
-3em -3em 0 0 green,
3em -3em 0 0 green,
-2em -2em 0 0 green,
@molotovbliss
molotovbliss / gist:9122178
Created February 20, 2014 20:09
enterprise.xml FPC with umask permissions & FPC Memcache example
<!-- example of two level cache setup with slow backend at files. -->
<full_page_cache>
<backend_options>
<cache_dir>full_page_cache</cache_dir>
</backend_options>
<slow_backend_options>
<hashed_directory_level>1</hashed_directory_level>
<hashed_directory_umask>0777</hashed_directory_umask>
<file_name_prefix>fpc</file_name_prefix>
<cache_dir><![CDATA[full_page_cache]]></cache_dir>