Skip to content

Instantly share code, notes, and snippets.

@lukeramsden
lukeramsden / renew-gpgkey.md
Created September 24, 2023 17:13 — forked from krisleech/renew-gpgkey.md
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@lukeramsden
lukeramsden / use-paginated-fetch.ts
Created January 18, 2025 20:30
usePaginatedFetch
import { useCallback, useMemo, useRef, useState } from "react"
import { produce } from "immer"
interface PaginatedFetchState {
pageSize: number
startingAfter: string | undefined
endingBefore: string | undefined
direction: 'forward' | 'backward'
isOnFirstPage: boolean
@lukeramsden
lukeramsden / pagination.ts
Created February 8, 2025 23:35
Zapatos Cursor-based pagination helper
import * as db from "zapatos/db";
import * as s from "zapatos/schema";
export interface Pagination {
limit?: number;
startingAfter?: string | null;
endingBefore?: string | null;
}
export interface PaginatedResult<T> {
function cK2() {
return `You are ${K4}, Anthropic's official CLI for Claude.`;
}
async function iR() {
return [`You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
Here are useful slash commands users can run to interact with you: