Skip to content

Instantly share code, notes, and snippets.

View kekkorider's full-sized avatar
:shipit:
I'm probably coding some bug

Francesco Michelini kekkorider

:shipit:
I'm probably coding some bug
View GitHub Profile
@kekkorider
kekkorider / disableScroll.js
Last active April 12, 2018 10:12
Disabling scroll the hard way
// Thanks to Hokascha fot the `{passive: false}` trick.
// https://stackoverflow.com/a/46423584
let touchStart = {x: 0, y: 0}
let touchOffset = {x: 0, y: 0}
let beforeTouchScrollY = 0
const setTouchstartCoords = e => {
touchStart = {
x: e.touches[0].pageX,
@kekkorider
kekkorider / Observer.php
Created November 18, 2016 08:56
Magento hreflang module
<?php
class Inchoo_Alternate_Model_Observer
{
public function alternateLinks()
{
$headBlock = Mage::app()->getLayout()->getBlock('head');
$stores = Mage::app()->getStores();
$product = Mage::registry('current_product');
$category = Mage::registry('current_category');