Skip to content

Instantly share code, notes, and snippets.

View lucianohgo's full-sized avatar
👋
Working hard to build great user experiences

Luciano H. Gomes lucianohgo

👋
Working hard to build great user experiences
View GitHub Profile
@lucianohgo
lucianohgo / _app.js
Last active May 7, 2020 10:46
Core Web Vitals Next.JS
import { useEffect } from 'react';
import { setUpCoreVitalsTracking } from '../lib/performance-metrics';
export default function App({ Component, pageProps }) {
useEffect(() => {
setUpCoreVitalsTracking();
}, []);
return <Component {...pageProps} />;
}
@lucianohgo
lucianohgo / DeferRender.js
Last active June 28, 2018 19:23
Components to Delay and Defer a render by animation frame and seconds respectively
import React from 'react';
import PropTypes from 'prop-types';
export const Null = () => null;
class DeferRender extends React.PureComponent {
state = { shouldRender: false };
componentDidMount() {
window.requestAnimationFrame(() => {
@lucianohgo
lucianohgo / image-net-extractor.py
Last active March 13, 2017 03:23
Script to extract and group files from ImageNet (http://www.image-net.org/)
import csv
import time
import os
import urllib.request
import sys
from multiprocessing.pool import ThreadPool
def main():
categories_path = "synset-categories.csv"
geturls_base = "http://image-net.org/api/text/imagenet.synset.geturls?wnid="