Skip to content

Instantly share code, notes, and snippets.

View AndreaRivadossi's full-sized avatar
♻️
Keep calm and clear cache

Andrea Rivadossi AndreaRivadossi

♻️
Keep calm and clear cache
View GitHub Profile
@magevision
magevision / DefaultConfigProvider.php
Created February 26, 2018 21:26
Get a Product Attribute in Checkout Summary
<?php
namespace MageVision\Blog16\Plugin\Checkout\Model;
use Magento\Checkout\Model\Session as CheckoutSession;
class DefaultConfigProvider
{
/**
* @var CheckoutSession
*/
@zack6849
zack6849 / HeaderPagination.php
Last active July 2, 2018 08:29
Magento 2 Pagination in header
<?php
namespace Revival\Seo\Block;
use Magento\Framework\View\Element\Template;
/**
* To make this appear in the header for the catalog, you'd need to add this as a block in ${THEME_DIR}/Magento_Catalog/layout/catalog_category_view.xml
*
* EG:
@Antoinebr
Antoinebr / lazy-loading.md
Last active May 29, 2017 10:23
lazy-loading.md

Lazy loading

For lazy loading I use lazysizes. Images can saturate the bandwith with mobile connection. We can load the images (not ATF (Above the fold) images) after the onLoad event or just before the user need them (onScroll)

@deanrather
deanrather / Github Web Hosting.md
Last active November 5, 2024 15:38
Free Hosting on GitHub

Free Hosting on GitHub

This guide will take you from zero webserver knowledge, to having your own free site hosted on GitHub. The only non-free bit is registering a domain name, which can be as cheap as $5/year.

This guide uses CrazyDomains as the Registrar, FreeDNS as the DNS, and GitHub as the Webserver.


1) Domain Registration and Setup

@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@ivandoric
ivandoric / list.phtml
Last active March 17, 2021 22:09
magento: Check if product is new in product listing
<?php
$newFromDate = Mage::getModel('catalog/product')->load($_product->getID())->getNewsFromDate();
$newToDate = Mage::getModel('catalog/product')->load($_product->getID())->getNewsToDate();
$now = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
if(($newFromDate < $now && $newFromDate != NULL) && ($newToDate > $now || $newToDate == "")){
echo "New Product";
}
?>
@bekapod
bekapod / local.xml
Created January 29, 2014 15:41
MAGENTO: Breadcrumbs on Account Pages
<?xml version="1.0"?>
<layout version="0.1.0">
<!--
///////////////////////////////////////////////////////
/////// BREADCRUMBS IN CUSTOMER ACCOUNT AREA ////////
///////////////////////////////////////////////////////
add default crumbs to display in all the customer account pages
this will add Home / My Account crubms.
-->
@h4cc
h4cc / satis_install.sh
Last active February 13, 2024 16:39
Guide to install a satis server for composer. It can mirror packages and create a index for own packages.
# Install a Webserver
apt-get -y install apache2
# Target docroot to /home/satis/web/
# Install PHP5 CLI and needed programs.
apt-get -y install php5-cli php5-curl php5-json git wget
# Add a specifix user for our task
adduser satis