Skip to content

Instantly share code, notes, and snippets.

View aryaniyaps's full-sized avatar
🎯
Focusing

Aryan Iyappan aryaniyaps

🎯
Focusing
View GitHub Profile
@aryaniyaps
aryaniyaps / dataloaders.py
Created March 23, 2025 10:20
Strawberry GraphQL dataloader creation utilities
from collections.abc import Awaitable, Callable
from typing import TypeVar
from bson import ObjectId
from strawberry.dataloader import DataLoader
T = TypeVar("T")
U = TypeVar(
"U", str, tuple[str, str]
) # the original key type (input), assumed to be a string
@aryaniyaps
aryaniyaps / main.py
Last active March 19, 2025 13:48
RBI Web Scraping
import os
import time
import requests
from playwright.sync_api import sync_playwright, TimeoutError as PlaywrightTimeoutError
from tenacity import retry, stop_after_attempt, wait_exponential
BASE_URL = "https://rbi.org.in/Scripts/BS_ViewBulletin.aspx"
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
@aryaniyaps
aryaniyaps / generate_webauthn_keys.py
Created March 16, 2025 03:14
Generate WebAuthn Credential Key Pair
import base64
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
def generate_webauthn_keys():
# Generate an ECDSA P-256 private key
private_key = ec.generate_private_key(ec.SECP256R1())