Skip to content

Instantly share code, notes, and snippets.

Findings (root cause)

  • Supabase invite emails default to ConfirmationURL (…/auth/v1/verify?token=…&type=invite&redirect_to=…). After verification, Supabase redirects to your site with tokens in the URL hash (#access_token=…). That requires client-side handling; otherwise no session/cookie is set and users land unauthenticated on your homepage.
  • Your app has a server route at app/auth/confirm/route.ts that expects token_hash and type query params and calls supabase.auth.verifyOtp({ type, token_hash }) to set cookies server-side—but the current invite link doesn’t hit that route and uses token (not token_hash).
  • Net: there’s a mismatch between the link Supabase sends and how your app expects to finalize auth; you’re not processing the hash fragment, so the invite appears to “do nothing”.

What “should” happen

  • Either: handle the hash fragment client-side (getSessionFromUrl) and then sync to server cookies; or: bypass the hash entirely by customizing the email invite link to point directly at your server ro
@juanqui
juanqui / gist:31220bd500d23af1c49f160c9252066f
Created October 3, 2025 14:02
move-to-australia-prompt-v3.md
## Task
Your task is to deeply and thoroughly research all of the aspects, requirements, challenges, and best practices for moving our family from the United States to Australia (ideally Sydney area).
I have already compiled a list of reports that we need to generate. Please refer to `## Reports` below which indicates all the reports we have to generate as well as the answers that need to be contained in each of them.
When writing each report, make sure you:
1. Include a section titled `## Recommendation` which contains the research-backed recommendation for our family.
2. All the other sections outside of `## Recommendation` need to be informational and not specific to our family.
# Task - Implement a dynamic LoRa power tuning algorithm
Your task is to implement a dynamic LoRa power tuning algoirithm that automatically determines the optimal LoRa radio transmit power to use in order to balance both reliable signal reception by the gateway and power effeciency of our sensor.
## Requirements
- Our STM32WL5M is configured for for RFO_LP with a maximum power output of 15dBm. We should never exceed 15dBm.
- The lowst possible power setting is 0dBm.
- Power can be increased in increments of 1dBm.
- At boot, we should start with a power of 8dBm.
@juanqui
juanqui / configuration.yaml
Created May 25, 2025 00:14
Home Assistant YAML Snippet for LeakyRF
# LeakyRF Custom Definition
template:
- sensor:
- name: "LeakyRF 24h Water Usage"
unique_id: leakyrf_24h_water_usage
unit_of_measurement: "gal"
state_class: "measurement"
device_class: "water"
state: >
@juanqui
juanqui / gist:af16f633ba8e6da4bdaab4476a180e56
Created December 29, 2023 04:25
esp32c3 wokwi connection logs
INFO - V (27014) wifi:
INFO - scan specific ssid=Wokwi-GUEST
INFO -
INFO - V (27081) wifi:
INFO - start max timer
INFO -
INFO - D (27241) wifi:
@juanqui
juanqui / bed.g
Last active August 26, 2021 16:14
CR-10 S4 Duet2Wifi Config w/ BLTouch and AC Heated Bed
M561 ; clear any bed transform
G29 S2 ; Clear bed height map
; Probe 2-points
M401 ; Deploy probe - deployprobe.g
G30 P0 X20 Y200 Z-9999 ; Center Left
G30 P1 X340 Y200 Z-9999 S2 ; Center Right
M402 ; Retract Probe - retractprobe.g
0x45b1fDcA7aa4acF6957c464815E3708B0aB7354a
@juanqui
juanqui / get_nest_temps.js
Last active July 1, 2016 04:11
Get Temperatures From Nest Thermostats
"use strict";
var request = require('request');
// request login
request({
url: 'https://home.nest.com/user/login',
method: 'POST',
headers: {
'user-agent': 'Nest/2.1.3 CFNetwork/548.0.4',
@juanqui
juanqui / gist:7564275
Created November 20, 2013 14:41
Golang Kqueue Snippet
// helpful links:
// https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/EV_SET.2.html
// http://julipedia.meroh.net/2004/10/example-of-kqueue.html
// create kqueue
kq, err := syscall.Kqueue()
if err != nil {
log.Println("Error creating Kqueue descriptor!")
return
}