export SLACK_DEVELOPER_MENU=true && open /Applications/Slack.app/localStorage.setItem("localConfig_v2", localStorage.getItem("localConfig_v2").replace(/\"is_unified_user_client_enabled\":true/g, '\"is_unified_user_client_enabled\":false'))| // ==UserScript== | |
| // @name ChatGPT Shorthands | |
| // @namespace local.chatgpt.shorthands | |
| // @version 1.2.0 | |
| // @description Adds prompt chips and keyboard shortcuts to new ChatGPT conversations. | |
| // @match https://chatgpt.com/* | |
| // @run-at document-idle | |
| // ==/UserScript== | |
| (() => { |
| // inject in any tiktok url: https://www.tiktok.com/@*/video/*,https://www.tiktok.com/@*/photo/* | |
| (() => { | |
| const ID = "tiktok-data-debugger"; | |
| document.getElementById(ID)?.remove(); | |
| const DATA_PATH = | |
| 'window.__$UNIVERSAL_DATA$__.__DEFAULT_SCOPE__["webapp.video-detail"].itemInfo.itemStruct'; | |
| const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); |
| const TIMEOUT_MS = 5000; | |
| const CHECK_INTERVAL_MS = 500; | |
| let startTime = Date.now(); | |
| const parseVersion = (versionStr) => { | |
| if (!versionStr) return null; | |
| const [main, pre] = versionStr.split('-'); | |
| const [major, minor, patch] = main.split('.').map(Number); | |
| let canaryVal = 0; |
| (function(console){ | |
| console.save = function(data, filename){ | |
| if(!data) { | |
| console.error('Console.save: No data') | |
| return; | |
| } | |
| if(!filename) filename = 'console.json' |
| import { RefObject, useEffect, useRef } from 'react'; | |
| function getScrollParent(node: HTMLElement | null): HTMLElement | null { | |
| const isElement = node instanceof HTMLElement; | |
| const overflowY = isElement && window.getComputedStyle(node).overflowY; | |
| const isScrollable = overflowY !== 'visible' && overflowY !== 'hidden'; | |
| if (!node) { | |
| return null; | |
| } else if (isScrollable && node.scrollHeight >= node.clientHeight) { |
| // paste this in your console | |
| document.querySelectorAll('.vjs-tech').forEach(element => element.playbackRate = 15) |
| import { DependencyList, EffectCallback, useEffect, useRef } from 'react'; | |
| export const useEffectWhen = (callback: EffectCallback, whatDeps: DependencyList, whenDeps: DependencyList) => { | |
| const prevWhenValuesRef = useRef<DependencyList>([]); | |
| useEffect(() => { | |
| const prevWhenDeps = prevWhenValuesRef.current; | |
| prevWhenValuesRef.current = whenDeps; | |
| for (let i = 0; i < whenDeps.length; i++) { |
export SLACK_DEVELOPER_MENU=true && open /Applications/Slack.app/localStorage.setItem("localConfig_v2", localStorage.getItem("localConfig_v2").replace(/\"is_unified_user_client_enabled\":true/g, '\"is_unified_user_client_enabled\":false'))| import { useEffect, useState } from 'react'; | |
| type Callback = (data?: any) => void; | |
| class EventBus<E extends string = string> { | |
| events: Partial<Record<E, Callback[]>>; | |
| constructor() { | |
| this.events = {}; | |
| } |
| // extracted from https://github.com/damiangreen/use-trace-update | |
| import { useEffect, useRef } from 'react'; | |
| export default function useTraceUpdate(props) { | |
| const prev = useRef(props); | |
| useEffect(() => { | |
| const changedProps = Object.entries(props).reduce((ps, [k, v]) => { | |
| if (prev.current[k] !== v) { | |
| ps[k] = [prev.current[k], v]; |