Skip to content

Instantly share code, notes, and snippets.

View Anxiro's full-sized avatar
🏃‍♂️
idkfa

Frank W. Anxiro

🏃‍♂️
idkfa
  • Denmark
View GitHub Profile
@Anxiro
Anxiro / soldprod.php
Created May 11, 2020 08:30 — forked from peterjaap/soldprod.php
Sold products % by category
<?php
require_once("app/Mage.php");
Mage::app();
$orders = Mage::getModel('sales/order')->getCollection();
$i = 0;
foreach ($orders as $key => $order) {
if (!$i) {
$startDate = strtotime($order->getCreatedAt());
@Anxiro
Anxiro / convertImages.sh
Created May 11, 2020 08:28 — forked from peterjaap/convertImages.sh
Convert images to smaller size and lower quality to reduce file sizes for Magento's original product photos
#!/bin/bash
# convertImages.sh
# Author: Peter Jaap Blaakmeer (elgentos.nl)
# https://gist.github.com/peterjaap/7080989
NEWQUALITY=80
NEWSIZE=1000
DIRECTORY=media/catalog/product/
du -hs $DIRECTORY
@Anxiro
Anxiro / .htaccess
Created May 11, 2020 08:25 — forked from peterjaap/.htaccess
.htaccess deny access to sensitive files Magento
<FilesMatch "\.htaccess|config\.php|composer\.json|composer\.lock|vendor|\.gitignore|install\.php|cron\.sh|config|config\/deploy\.rb|scheduler_cron\.sh|downloader|scripts|shell|includes|dev|LICENSE.txt|LICENSE.html|RELEASE_NOTES.txt|\.htaccess\.sample|LICENSE_AFL.txt">
Order allow,deny
Deny from all
</FilesMatch>
@Anxiro
Anxiro / Magento1ValetDriver.php
Created May 11, 2020 08:24 — forked from peterjaap/Magento1ValetDriver.php
Magento 1 Driver for Valet (https://laravel.com/docs/5.3/valet) - we put Magento in a subdir called 'magento' in our Git repo. So place this in ~/.valet/Drivers/Magento1ValetDriver.php and you're good to go.
<?php
class Magento1ValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@Anxiro
Anxiro / Image.html
Created October 26, 2017 21:20 — forked from mdbloch/Image.html
TYPO3 8.7 - Responsive Image
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<picture>
<source srcset="{f:uri.image(image: file, maxWidth: settings.maxImgWidth, cropVariant: 'default')}" media="(min-width: 1200px)">
<source srcset="{f:uri.image(image: file, maxWidth: '992', cropVariant: 'desktop')}, {f:uri.image(image: file, maxWidth: '1984', cropVariant: 'desktop')} 2x" media="(min-width: 992px)">
<source srcset="{f:uri.image(image: file, maxWidth: '768', cropVariant: 'tablet')}, {f:uri.image(image: file, maxWidth: '1536', cropVariant: 'tablet')} 2x" media="(min-width: 768px)">
<source srcset="{f:uri.image(image: file, maxWidth: '768', cropVariant: 'mobile')}, {f:uri.image(image: file, maxWidth: '1536', cropVariant: 'mobile')} 2x" media="(max-width: 767px)">
<!---Fallback--->
<img class="img-responsive" src="{f:uri.image(image: file, maxWidth: settings.maxImgWidth, cropVariant: 'default')}" alt="{image.alternative}" longdesc="{image.description}" title="{image.title}">
</picture>