- Default to
gt
. Substitute any suggestedgit
command with the nearestgt
command if available. - Keep stacks healthy. When a branch with children changes, rely on
gt
(e.g.,gt modify
,gt sync
) to restack; avoid manual rebases unless unavoidable. - Avoid empty branches. Do not create an empty branch first. Add changes →
gt create
. - Show full commands in docs; aliases (
gt m
,gt ss
) are acceptable in chat examples. - Teach the five‑step workflow (Create → Submit → Address Feedback → Merge → Sync).
This file contains hidden or 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 GoogleOAuth, { GoogleKey } from 'cloudflare-workers-and-google-oauth' | |
import { GoogleAuth } from "google-auth-library"; | |
import { GenerateContentRequest, GenerativeModel } from "@google-cloud/vertexai"; | |
import authJSON from "./auth.json"; // Service account | |
class JsonAuth extends GoogleAuthBase { | |
private oauth: GoogleOAuth | |
constructor(private readonly json: GoogleKey) { | |
super(); | |
this.oauth = new GoogleOAuth(json, ["https://www.googleapis.com/auth/cloud-platform"]) |
This file contains hidden or 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
'use client'; | |
import React from 'react'; | |
import ReactMarkdown from 'react-markdown'; | |
import rehypeKatex from 'rehype-katex'; | |
import rehypeRaw from 'rehype-raw'; | |
import remarkGfm from 'remark-gfm'; | |
import remarkMath from 'remark-math'; |
This file contains hidden or 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
const [scrollPos, onScroll] = useScrollPos('top'); | |
return ( | |
<GridList | |
items={list.items} | |
className={cn( | |
'grow overflow-y-auto flex flex-col gap-px my-2', | |
'border-y border-border data-[scroll-pos="top"]:border-t-transparent data-[scroll-pos="bottom"]:border-b-transparent transition duration-100' | |
)} | |
aria-label="FileList sidebar" |
This file contains hidden or 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
/** | |
* This module provides a storage adapter for Durable Objects. | |
* | |
* https://github.com/partykit/partykit/blame/main/packages/y-partykit/src/storage.ts | |
* @packageDocumentation | |
*/ | |
import { | |
Chunk, | |
StorageAdapterInterface, |
This file contains hidden or 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 function debounceAutocompletion( | |
language: Language, | |
source: CompletionSource, | |
wait: number = 500, | |
) { | |
let currContext: CompletionContext; | |
let cancel = () => {}; // no-op | |
return [ | |
language.data.of({ | |
autocomplete: (context: CompletionContext) => { |
This file contains hidden or 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
// Copy of https://github.com/craftzdog/react-codemirror-runmode | |
// with support for custom languages | |
import React from "react"; | |
import { Parser } from "@lezer/common"; | |
import { Highlighter } from "@lezer/highlight"; | |
import { StyleModule } from "style-mod"; | |
import highlight from "./highlight"; |
This file contains hidden or 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
::-webkit-scrollbar { | |
height: 1rem; | |
width: 0.5rem; | |
} | |
::-webkit-scrollbar:horizontal { | |
height: 0.5rem; | |
width: 1rem; | |
} |
This file contains hidden or 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 React from 'react'; | |
const ResizableDiv = function ResizableDiv(props: { onChange: (dx: number) => void }) { | |
const { onChange = () => null, ...otherProps } = props; | |
const resizeRef = React.useRef<HTMLElement | null>(null); | |
const [resizing, setResizing] = React.useState(false); | |
const handlePointerDown = React.useCallback( | |
(event: React.PointerEvent) => { |
This file contains hidden or 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 function setGlobalRootColor() { | |
try { | |
const rootElement = document.documentElement; | |
const classList = rootElement.classList; | |
classList.remove('light', 'dark'); | |
const themePreference = localStorage.getItem('theme'); | |
if (themePreference === 'system' || (!themePreference && true)) { | |
const prefersDark = '(prefers-color-scheme: dark)'; | |
const darkModeMediaQuery = window.matchMedia(prefersDark); |
NewerOlder