This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adapted from: https://www.npmjs.com/package/to-px | |
const PIXELS_PER_INCH = measure('in', document.body) // 96 | |
export function toPixels(input: number | string, element: HTMLElement = document.body): number { | |
if (typeof input === 'number') return input | |
input = input.toLowerCase() | |
// Support passing a unit with no amount prefix | |
let px = unitToPixels(input, element) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LeastRecentlyUsedCache } from './lru' | |
const cache = new LeastRecentlyUsedCache<string, number>(500) | |
const canvasElem = document.createElement('canvas') | |
canvasElem.setAttribute( | |
'style', | |
'position: absolute; top: -2000px; left: -2000px; overflow: hidden; clip: rect(0 0 0 0); z-index: -100', | |
) | |
document.body.appendChild(canvasElem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class LeastRecentlyUsedCache<Key, Value> { | |
protected _capacity: number | |
protected _values: Map<Key, Value> | |
protected _timestamps: Map<Key, number> | |
constructor(capacity: number) { | |
this._capacity = capacity | |
this._values = new Map() | |
this._timestamps = new Map() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"name": "Beginner Pro", | |
"type": "light", | |
"colors": { | |
// base color | |
"focusBorder": "#f2f4f700", | |
"foreground": "#000000", | |
"editor.background": "#f2f4f7", | |
"editor.foreground": "#000000", | |
"scrollbar.shadow": "#f2f4f7", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name X.com ~ Shift+Click to Block | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-04-10 | |
// @description Block the tweet under the cursor using the Shift key and click. | |
// @author Alec Larson | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name X.com ~ Shift+Click to Mute | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-04-10 | |
// @description Mute the tweet under the cursor using the Shift key and click. | |
// @author Alec Larson | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> www@0.0.1 astro ~/docs/www | |
> astro "dev" "--verbose" | |
2024-04-10T03:53:28.361Z astro:cli --verbose flag enabled! Enabling: DEBUG="astro:*,vite:*" | |
2024-04-10T03:53:28.361Z astro:cli Tip: Set the DEBUG env variable directly for more control. Example: "DEBUG=astro:*,vite:* astro build". | |
2024-04-10T03:53:28.820Z astro:telemetry [notify] last notified on 1712698445704 | |
2024-04-10T03:53:29.395Z astro:Failed to load config with Node TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for ~/docs/www/node_modules/.pnpm/@astrojs+starlight@0.21.5_astro@4.5.17/node_modules/@astrojs/starlight/index.ts | |
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9) | |
at defaultGetFormat (node:internal/modules/esm/get_format:203:36) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google AI Studio: Zen Mode | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description Expand the chat to fill the screen. | |
// @author Alec Larson | |
// @match https://aistudio.google.com/app/prompts/* | |
// @grant GM_addStyle | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Gemini Finished Notification | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description Notify when Gemini is done loading a model response | |
// @author Claude 3 | |
// @match https://aistudio.google.com/app/prompts/* | |
// @grant GM_notification | |
// @grant GM_getTab | |
// @grant GM_openInTab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Gemini Finished Notification | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description Notify when Gemini is done loading a model response | |
// @author Claude 3 | |
// @match https://aistudio.google.com/app/prompts/* | |
// @grant GM_notification | |
// @grant GM_getTab | |
// @grant GM_openInTab |
NewerOlder