Skip to content

Instantly share code, notes, and snippets.

View paragbaxi's full-sized avatar

Parag Baxi paragbaxi

View GitHub Profile
@paragbaxi
paragbaxi / gist:3c1b53544f6ce347108a2a7de43f598a
Created February 20, 2026 15:35
Launch uiautomatorviewer-gradle on macOS (Apple Silicon / JDK 17) without crashing
#!/usr/bin/env bash
# Launch uiautomatorviewer-gradle on macOS with JDK 17
# Without JAVA_HOME + -XstartOnFirstThread, the app crashes immediately on macOS.
#
# Source: https://github.com/pvmagacho/uiautomatorviewer-gradle
# Fix: https://github.com/paragbaxi/uiautomatorviewer-gradle
# 1. Build
./gradlew -Dorg.gradle.java.home="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home" installDist
@paragbaxi
paragbaxi / auto-switching-nextdns-profiles-per-macos-user.md
Last active June 5, 2025 22:39
Auto-Switching NextDNS Profiles per macOS User (Supports Fast User Switching)

🛡️ Auto-Switching NextDNS Profiles per macOS User (Updated)

This setup ensures that each macOS user gets their assigned NextDNS config — even with fast user switching and standard (non-admin) accounts — without requiring manual scripts, prompts, or login hooks.


🎯 Goal

Automatically install the correct NextDNS profile within 30 seconds of user login or fast user switch, but only if the current profile is incorrect.

@paragbaxi
paragbaxi / headers.md
Last active February 20, 2026 16:42
Access internal web app APIs using Puppeteer to capture headers, then replicate in Python

Access Internal APIs with Puppeteer + Python

Many internal web apps expose APIs that aren't publicly documented. This technique uses Puppeteer to intercept the browser's XHR requests, capture the exact headers being sent, then replicate them in Python to access the API directly — bypassing the UI entirely.

Steps

1. Intercept headers with Puppeteer

const puppeteer = require('puppeteer');