List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
import { type ComponentType, createElement, forwardRef } from 'react' | |
import type { TextProps } from 'react-native' | |
// uncomment for NativeWind support | |
//import { cssInterop } from 'nativewind' | |
const LeanText = forwardRef((props, ref) => { | |
return createElement('RCTText', { ...props, ref }) | |
}) as ComponentType<TextProps> |
"use client"; | |
import type { ColumnDef } from "@tanstack/react-table"; | |
export interface Schema { | |
region: string; | |
trend: string; | |
p50: number; | |
} |
import * as React from 'react'; | |
const useIsFirstRender = (): boolean => { | |
const isFirst = React.useRef(true); | |
if (isFirst.current) { | |
isFirst.current = false; | |
return true; | |
} else { |
import axios from 'axios' | |
import { useOptimisticMutation } from "./useOptimisticMutation.ts" | |
type Response = boolean | |
type Error = unknown | |
type MutationVariables = {itemId: string} | |
type Items = {id: string; name: string}[] | |
type Likes = {itemId: string}[] | |
type History = {type: string}[] |
/* Layout and Text components are my own utility components. Replace them by your own. */ | |
import { memo, useEffect, useMemo, useState } from "react"; | |
import { ViewStyle } from "react-native"; | |
import { A } from "@mobily/ts-belt"; | |
import mitt from "mitt"; | |
import { v4 as uuid } from "@lukeed/uuid"; | |
import Animated, { | |
Layout as REALayout, | |
Easing, |
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj | |
Cloning into 'my-awesome-proj'... | |
ssh: connect to host github.com port 22: Connection timed out | |
fatal: Could not read from remote repository. | |
$ # This should also timeout | |
$ ssh -T git@github.com | |
ssh: connect to host github.com port 22: Connection timed out | |
$ # but this might work |