Skip to content

Instantly share code, notes, and snippets.

View jefrydco's full-sized avatar
🎯
Focusing

Jefry Dewangga jefrydco

🎯
Focusing
View GitHub Profile
@jefrydco
jefrydco / core-web-vitals-compliance-rates-indonesia.sql
Created January 23, 2021 03:30
Calculate the percent of origins that comply with each Core Web Vital's "good" threshold for 75% or more of experiences for Indonesia country.
#standardSQL
# This query processes 735.9 MB.
# Calculate the percent of origins that comply with each Core Web Vital's "good" threshold for 75% or more of experiences.
CREATE TEMP FUNCTION IS_GOOD (good FLOAT64, needs_improvement FLOAT64, poor FLOAT64) RETURNS BOOL AS (
good / (good + needs_improvement + poor) >= 0.75
);
CREATE TEMP FUNCTION IS_NON_ZERO (good FLOAT64, needs_improvement FLOAT64, poor FLOAT64) RETURNS BOOL AS (
good + needs_improvement + poor > 0
@sindresorhus
sindresorhus / esm-package.md
Last active May 4, 2025 07:03
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.