Skip to content

Instantly share code, notes, and snippets.

@MendyLanda
MendyLanda / use-online.ts
Created September 5, 2025 09:50
better-auth & expo, offline support
import { useEffect, useState } from "react";
import * as Network from "expo-network";
export function useOnline() {
const [isOnline, setIsOnline] = useState(true);
useEffect(() => {
const checkNetworkStatus = async () => {
const networkState = await Network.getNetworkStateAsync();
setIsOnline(networkState.isConnected ?? false);
@ellsies
ellsies / README.md
Last active July 19, 2026 04:44
Crackover (Complete free version of crossover)
@mjbalcueva
mjbalcueva / password-input.tsx
Last active July 23, 2026 00:44
shadcn ui custom password input
'use client'
import * as React from 'react'
import { EyeIcon, EyeOffIcon } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Input, type InputProps } from '@/components/ui/input'
import { cn } from '@/lib/utils'
const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(({ className, ...props }, ref) => {
@jabedzaman
jabedzaman / spotify.js
Last active June 16, 2024 22:37
Fetch currently playing song on Spotify
// pages/api/spotify.
import querystring from 'querystring';
const {
NEXT_PUBLIC_SPOTIFY_CLIENT_ID: client_id,
NEXT_PUBLIC_SPOTIFY_CLIENT_SECRET: client_secret,
NEXT_PUBLIC_SPOTIFY_REFRESH_TOKEN: refresh_token,
} = process.env;
@ygotthilf
ygotthilf / jwtRS256.sh
Last active March 23, 2026 01:32
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub