Skip to content

Instantly share code, notes, and snippets.

@Talor-A
Talor-A / cloudSettings
Created September 2, 2018 00:00
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-02T00:00:34.435Z","extensionVersion":"v3.1.1"}
@Talor-A
Talor-A / cloudSettings
Created September 2, 2018 00:01
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-02T00:01:25.104Z","extensionVersion":"v3.1.1"}
@Talor-A
Talor-A / cloudSettings
Last active March 19, 2019 04:49
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-03-19T04:49:46.656Z","extensionVersion":"v3.2.7"}
@Talor-A
Talor-A / cloudSettings
Last active March 19, 2019 04:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-03-19T04:55:34.178Z","extensionVersion":"v3.2.7"}
/**
* get all keys from T of type `string` (exclude `number` and `symbol`)
*/
export type ObjectKeys<T> = Extract<keyof T, string>
export type ObjectValues<T> = T[ObjectKeys<T>]
/**
* Object.keys(), but assert that an array of T's keys is returned, not `string[]`
*/
export const objectKeys = <T>(obj: T) => Object.keys(obj) as ObjectKeys<T>[]
@Talor-A
Talor-A / useSubscribeSuspense.ts
Created June 30, 2021 02:29
useSubscribe suspense
import { ReadTransaction, Replicache } from "replicache/out/replicache";
class Deferred<T> {
promise: Promise<T>;
resolve!: (value: T | PromiseLike<T>) => void;
reject!: (reason?: any) => void;
constructor() {
@Talor-A
Talor-A / MenuItem.tsx
Last active May 8, 2024 20:02
connect react-aria-components with next router
import {
MenuItem as AriaMenuItem,
MenuItemProps as AriaMenuItemProps
} from 'react-aria-components';
interface MenuItemProps<T>
extends ReactAriaNextLinkProps,
Omit<AriaMenuItemProps<T>, 'children' | 'href'> {
}
#!/bin/bash
# creates a new worktree.
# Usage: git wt [revision] [command]
# If no revision is specified, it will use the current HEAD.
# you can use `.` as a shortcut for HEAD too.
# If no command is specified, it will open the worktree in your IDE:
# this is `cursor` for me, but you can change it to your favorite editor.
# Function to generate a unique worktree name
on open dropped_items
repeat with imageFile in dropped_items
set imagePath to POSIX path of imageFile
try
set cmd to "PATH=$PATH:~/.local/bin && llm prompt \"You are a helpful image transcriber bot and it is your job to explain exactly what is in images so that blind people and other LLMs can understand the image. first state in plain terms what the pictured image looks like. then exactly transcribe word-for-word all text inside. it is important to transcribe all content so that no detail is omitted. do not include any other text in your reply besides these two things. EXAMPLE: 'a chat app with the message hello world as the first reply'. Now give your description of this image:\" -a " & quoted form of imagePath
set altText to do shell script cmd
display dialog altText buttons {"Copy", "OK"} default button "Copy"
if button returned of result is "Copy" then
set the clipboard to altText
end if
respond only in spanish.
correct my grammar first before answering questions or responding.
if i include bits of english, it's probably because I don't know the word. provide the spanish translation when appropriate.
i am using the comprehensible input method of spanish learning,. it is more helpful to me if you provide longer example paragraphs with context, rather than short phrases.