Skip to content

Instantly share code, notes, and snippets.

View vanling's full-sized avatar
💚
Nuxt3

Ling vanling

💚
Nuxt3
View GitHub Profile
import CredentialsProvider from 'next-auth/providers/credentials'
import { NuxtAuthHandler } from '#auth'
export default NuxtAuthHandler({
// secret needed to run nuxt-auth in production mode (used to encrypt data)
secret: useRuntimeConfig().authSecret,
providers: [
CredentialsProvider.default({
name: 'Directus',
@vanling
vanling / fastSort.js
Created September 9, 2020 06:28
Javascript - Sorting on two (specific) types (slow & fast)
//SLOW
const arr = [
{ flag: true, other: 1 },
{ flag: true, other: 2 },
{ flag: false, other: 3 },
{ flag: true, other: 4 },
{ flag: true, other: 5 },
{ flag: true, other: 6 },
{ flag: false, other: 7 }
];