Skip to content

Instantly share code, notes, and snippets.

View AndresInSpace's full-sized avatar

Andrew S AndresInSpace

View GitHub Profile
@AndresInSpace
AndresInSpace / magento.bestsellers.catalog.category.collection.php
Created April 3, 2019 14:33
Magento 1 Bestsellers from Order Data (Not aggregated data)
/* Best Sellers Category */
$today = time();
$from = date('Y-m-d', strtotime("-12 months",$today));//pull best sellers from 12 months prior order data
$to = date("Y-m-d", $today);
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$orderTableAliasName = $readConnection->quoteIdentifier('order');
@AndresInSpace
AndresInSpace / insta-scrap-open-image.bookmarklet.js
Last active June 20, 2019 16:33
For Designers: Scrap IG Image using Bookmarklet JS+Alerts/Prompts
//add this as the URL of your bookmark, then just click the bookmark to trigger the script when you are on an IG page with an image selected.
javascript:(function(){var dialog = document.querySelector('.vCf6V'); var standAlone = document.querySelector('._97aPb'); if(!dialog && standAlone){ dialog = standAlone; } if(!dialog && !standAlone){ alert('Please open a IG image to scrape it.'); } else { dialog.querySelectorAll('.FFVAD').forEach(function(e){ var list = e.srcset.split(',').reverse(); list.forEach(function(source){ var sizeimg = source.split(' '); prompt('The image size is:'+sizeimg[1],sizeimg[0]) }) }) }})();
//alternative; opens largest image in new tab automatically
javascript:(function(){var dialog = document.querySelector('.vCf6V'); var standAlone = document.querySelector('._97aPb'); if(!dialog && standAlone){ dialog = standAlone; } if(!dialog && !standAlone){ alert('Please open a IG image to scrape it.'); } else { dialog.querySelectorAll('.FFVAD').forEach(function(e){ var list = e.srcset.split(','