Skip to content

Instantly share code, notes, and snippets.

View thehappybug's full-sized avatar
🧙‍♂️

Mehdi Raza Jaffery thehappybug

🧙‍♂️
  • APIMATIC
  • Pakistan
View GitHub Profile

Task

[Single imperative sentence. e.g. "Add pagination to the GET /users endpoint."]

Intent

[One or two sentences on why. e.g. "To prevent timeouts when the users table is large."]

Relevant Context

  • [File or module to read first]
  • [Existing pattern to follow, e.g. "see how /posts handles this in routes/posts.ts"]
@thehappybug
thehappybug / llm-prompts.md
Created January 27, 2025 14:26
Mehdi's LLM Prompts

Create FAQs for Product Release/Changelog/RFCs/Document

I find this prompt useful when I need to quickly come up with some basic FAQs to include as part of my document. I use this format with Google Gemini inside Google Docs quite frequently:

Format:

[Product or company context].

[Document context].
@thehappybug
thehappybug / additional-properties-json-simple.json
Last active January 23, 2024 05:33 — forked from SidneyAllen/character-thor-simple.json
additional-properties-json-simple
{
"name": "Thor",
"universe": "Marvel",
}
@thehappybug
thehappybug / openapi.yaml
Created November 1, 2023 00:35
Using Optional and Nullable Properties: Example 3
Profile:
title: Profile
required:
- middle_name
- rider-id
type: object
properties:
first_name:
type: string
description: First name of the Uber user.
@thehappybug
thehappybug / openapi.yaml
Created November 1, 2023 00:26
Using Optional and Nullable Properties: Example 2
Profile:
title: Profile
required:
- middle_name
- rider-id
type: object
properties:
first_name:
type: string
description: First name of the Uber user.
@thehappybug
thehappybug / openapi.yaml
Created November 1, 2023 00:10
Using Optional and Nullable Properties: Example 1
paths:
"/products":
get:
parameters:
- name: latitude
in: query
description: Latitude component of location.
required: true
style: form
- name: longitude
@thehappybug
thehappybug / docusaurus-seo.md
Last active February 7, 2023 19:37
Docusaurus Site SEO Checklist

Docusaurus Site SEO Checklist

Basic SEO checklist when working with Docusaurus

Between the title, description, your pages' links and the pages' content, you have 80% of your SEO covered.

Extended SEO Guidelines

// WITHOUT COLLECT PARAMS
export class PaymentsApi extends BaseApi {
async listPayments(
beginTime?: string,
endTime?: string,
sortOrder?: string,
cursor?: string,
locationId?: string,
total?: number,
last4?: string,
@thehappybug
thehappybug / react-fuzzy-picker.d.ts
Created July 10, 2018 05:45
Typescript type declaration for Fuzzy Picker
declare module 'react-fuzzy-picker' {
import * as React from 'react';
export interface FuzzyPickerProps<T> {
label?: string;
displayCount?: number;
cycleAtEndsOfList?: boolean;
onChangeHighlightedItem?: (choice: T) => void;
isOpen: boolean;
onClose: () => void;
// This function takes a component...
export function withAppContext(Component) {
// ...and returns another component...
return function ComponentBoundWithAppContext(props) {
// ... and renders the wrapped component with the current context!
// Notice that we pass through any additional props as well
return (
<AppContextConsumer>
{appContext => <Component {...props} appContext={appContext} />}
</AppContextConsumer>