Skip to content

Instantly share code, notes, and snippets.

View nasal's full-sized avatar

Rudi Kovač nasal

View GitHub Profile
@nasal
nasal / LICENSE
Created January 12, 2017 10:35 — forked from engelfrost/LICENSE
Fake localStorage. Useful for Safari Private Browsing and browsers that don't implement localStorage.
The MIT License (MIT)
Copyright (c) 2015 Textalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@nasal
nasal / touch.js
Created February 13, 2014 00:12 — forked from rogeruiz/touch.js
JS: handle touch events on multiple devices
function handleTouch (evt) {
var touchX, touchY, xOffset, yOffset;
if (window.navigator.msPointerEnabled) {
var bodyEl = document.getElementByTagName('body')[0];
bodyEl.style.msTouchAction = 'none';
bodyEl.style.touchAction = 'none';
}
// Normalize your touch events
touchX = evt.originalEvent.pageX || evt.originalEvent.changedTouches[0].screenX;
touchY = evt.originalEvent.pageY || evt.originalEvent.changedTouches[0].screenY;