Skip to content

Instantly share code, notes, and snippets.

View x-fran's full-sized avatar

Francisc x-fran

View GitHub Profile
@x-fran
x-fran / magento-reset-dashboard.sql
Created May 3, 2022 22:16 — forked from mystix/magento-reset-dashboard.sql
Magento: reset dashboard data
SET foreign_key_checks = 0;
-- Last 5 Search Terms / Top 5 Search Terms
TRUNCATE TABLE catalogsearch_fulltext;
TRUNCATE TABLE catalogsearch_query;
TRUNCATE TABLE catalogsearch_result;
-- Dashboard stats (e.g. "Most Viewed Products" etc)
TRUNCATE TABLE report_compared_product_index;
TRUNCATE TABLE report_event;
@x-fran
x-fran / flatten.py
Last active December 11, 2017 13:07
Simple function to flatten multidimensional lists in python
def flatten(lst):
"""
Flatten nested lists
:param lst: Nested list. Any depth
:return: flat list
"""
for e in lst[:]:
if type(e) is list:
lst.remove(e)
lst += flatten(e)
@x-fran
x-fran / php-zf2-resources.md
Last active August 29, 2015 14:27 — forked from AV4TAr/php-zf2-resources.md
A bunch of resources for PHP and Zend Framework 2