Skip to content

Instantly share code, notes, and snippets.

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

Mehdi Raza Jaffery thehappybug

🧙‍♂️
  • APIMATIC
  • Pakistan
View GitHub Profile
@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>
import * as React from "react";
import { AppContextInterface, withAppContext } from "./AppContext";
const PostInfoComp = ({ appContext }: { appContext?: AppContextInterface }) =>
appContext && (
<div>
Name: {appContext.name} <br />
Author: {appContext.author} <br />
Url: {appContext.url}
</div>
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export function withAppContext<
P extends { appContext?: AppContextInterface },
R = Omit<P, 'appContext'>
>(
Component: React.ComponentClass<P> | React.StatelessComponent<P>
): React.SFC<R> {
return function BoundComponent(props: R) {
return (