Skip to content

Instantly share code, notes, and snippets.

View discountscott's full-sized avatar

Scott Moore discountscott

  • DF Supply, Inc.
  • Twinsburg, OH
View GitHub Profile
@discountscott
discountscott / MagentoSnippets.md
Last active March 4, 2019 20:49 — forked from davidalexander/gist:1086455
Magento Snippets

Magento Snippets

Clear cache/reindex

<?php
// clear cache
Mage::app()->removeCache('catalog_rules_dirty');
// reindex prices
Mage::getModel('index/process')->load(2)->reindexEverything();
@discountscott
discountscott / magento-sql-fixes-SMOORE.sql
Last active March 4, 2019 20:49
Fix Magento SQL issues (including indexer)
-- Forcefully fixes most Magento SQL issues...
-- Truncates all old indexes, flat data, & logs
-- DF Supply, Inc.
-- SMOORE 2/17/2016
-- BACK UP DATABASE PRIOR!!!!!
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
@discountscott
discountscott / magento-truncate-all-products.sql
Created February 17, 2016 21:26
Truncate all products from Magento
-- Drop all products from Magento
-- DF Supply, Inc.
-- SMOORE 2/17/2016
-- BACK UP DATABASE PRIOR!!!!!
-- Run Index cleanup SQL after this action
-- Be sure to uncomment line for EAV index
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;

PHPExcel Cheat Sheet

Documentation

Snippets

Install.

composer require phpoffice/phpexcel
@discountscott
discountscott / gist:6922748caf20dbb05adb6f3b4241f622
Created April 5, 2023 23:47
Python in windows (use trusted root CA in windows cert store)
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip-system-certs