Skip to content

Instantly share code, notes, and snippets.

View greiner94's full-sized avatar

Gennadiy Greiner greiner94

  • Ukraine
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
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;