Skip to content

Instantly share code, notes, and snippets.

View thevisioner's full-sized avatar
🚀
working hard to make the world better with software

Raimonds Sarkanbardis thevisioner

🚀
working hard to make the world better with software
View GitHub Profile
@thevisioner
thevisioner / .env.local.example
Created March 7, 2023 18:42
User Authentication in Next.js with Auth.js and Strapi
GOOGLE_OAUTH_CLIENT_ID=
GOOGLE_OAUTH_CLIENT_SECRET=
NEXTAUTH_SECRET=
# Use 127.0.0.1 instead of localhost to avoid issues with NextAuth.js
NEXTAUTH_URL=http://127.0.0.1:3000
STRAPI_BACKEND_URL=http://127.0.0.1:1337
@thevisioner
thevisioner / README.md
Created February 16, 2023 10:31 — forked from jonathantneal/README.md
Nearest Normal Ratio Calculator

Nearest Normal Aspect Ratio

This function returns the nearest aspect ratio of a width and height within a limited range of possible aspect ratios.

In other words, while 649x360 technically has an aspect ratio of 649:360, it’s often useful to know that the nearest normal aspect ratio is actually 9:5 (648x360).

nearestNormalAspectRatio(width, height, [side], [maxWidth], [maxHeight])