Skip to content

Instantly share code, notes, and snippets.

View rcstanciu's full-sized avatar
🦄
Focusing

Rares Stanciu rcstanciu

🦄
Focusing
View GitHub Profile
@z4nr34l
z4nr34l / next-real-ip.ts
Created April 10, 2024 08:49
Simple function to fetch users real IP address in nextjs app on vercel including cloudflare proxy
/**
* The fallback IP address to use if the real IP address cannot be determined.
*/
const FALLBACK_IP_ADDRESS = '0.0.0.0';
/**
* Returns the real IP address of the client.
* @param request - The incoming request.
* @param cfProxy - Whether the client is behind a Cloudflare proxy.
* @returns The real IP address of the client.
@davidhariri
davidhariri / jwt-apple-signin.py
Created October 12, 2019 18:14
Code required to verify Sign in with app-made Apple JWT tokens server-side in Python
import jwt
from jwt.algorithms import RSAAlgorithm
import requests
from time import time
import json
import os
APPLE_PUBLIC_KEY_URL = "https://appleid.apple.com/auth/keys"
APPLE_PUBLIC_KEY = None