Skip to content

Instantly share code, notes, and snippets.

View dougwithseismic's full-sized avatar
🎯
For Hire

Doug silkstone dougwithseismic

🎯
For Hire
View GitHub Profile
@dougwithseismic
dougwithseismic / clientsite.html
Last active September 1, 2022 13:21
JavaScript Express / Node : How can I serve different scripts to different customers like Hotjar does?
<script defer src='https://my.backend.io/v1/library/customer-xyz123/ />
import { getCalApi } from "@calcom/embed-react"
import { useRef, useEffect } from "react"
const useCalDotCom = (namespace: string, link: string, config: object) => {
const calRef = useRef<any>(null)
useEffect(() => {
const initCal = async () => {
const cal = await getCalApi()
// Configuration object for the search
const searchConfig = {
searchCriteria: { user: { id: true, email: true } }, // What we're looking for
maxDepth: 50, // How deep to search in the tree
stopAfterFirst: false, // Whether to stop after finding the first match
searchPaths: ["memoizedProps", "memoizedState"], // Where to look in each node
mainSelector: "#__next", // The root element of our React app
callback: (matchingObjects) => {
matchingObjects.forEach(({ matchingObject, fiberNode }) => {
console.log("Found matching object:", matchingObject);
// ==UserScript==
// @name DeepSeek Auto-Refresh on Server Busy
// @namespace Violentmonkey Scripts
// @match https://chat.deepseek.com/a/chat/*
// @grant none
// @version 1.1
// @author Doug Silkstone <[email protected]>
// @description Auto-clicks refresh button when server is busy
// ==/UserScript==