Skip to content

Instantly share code, notes, and snippets.

View juanallo's full-sized avatar

Juan Manuel Allo Ron juanallo

View GitHub Profile
@juanallo
juanallo / lazyLoadImages.js
Last active May 25, 2020 00:14
Lazy load images with IntersectionObserver
if(window.IntersectionObserver){
const observe = function (entries, observer) {
entries.forEach(function(entry) {
if(entry.isIntersecting) {
const img = entry.target
const src = img.dataset.src
const srcset = img.dataset.srcset
requestIdleCallback(function () {
if(srcset) {
@juanallo
juanallo / new_gist_file
Created October 9, 2013 23:00
Skip mvn tests
-Dmaven.test.skip=true
-DskipTests=true