This file contains 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 { PostgrestSingleResponse, SupabaseClient } from "@supabase/supabase-js"; | |
// generated from `supabase gen types typescript` | |
import { Database, TablesInsert, TablesUpdate } from "./types"; | |
export type PublicTableName = keyof Database["public"]["Tables"]; | |
export type TableMutationPatch<TName extends PublicTableName> = Partial<{ | |
inserts: TablesInsert<TName>[]; | |
updates: TablesUpdate<TName>[]; | |
deletes: string[]; |
This file contains 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
function App() { | |
const itemId: string | null = /* --snip-- */; | |
return <Item id={itemId} />; | |
} | |
interface ItemProps { | |
id: string | null; | |
} |
This file contains 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
/** | |
* Handle errors more declaratively without try catch. | |
* | |
* Non-async functions returning `T` will return `Result<T, unknown>`, and | |
* async functions returning `Promise<T>` will return | |
* `Promise<Result<T, unknown>>`. | |
* | |
* Supports overloaded function definitions. Refer to | |
* {@link OverloadedResultFn}. | |
* |
This file contains 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
type Decr = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; | |
type Obj = Record<string, unknown>; | |
type Prettify<T> = { | |
[K in keyof T]: T[K]; | |
} & NonNullable<unknown>; | |
type ValuesOf<T> = T[keyof T]; |
This file contains 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 {getContext, setContext} from 'svelte'; | |
interface Context<TValue> { | |
get: () => TValue | null; | |
set: (currentValue: TValue) => void; | |
} | |
/** | |
* Allow strongly typed Svelte context getters and setters while using a unique | |
* Symbol instead of a string key to avoid any potential key conflicts. |
This file contains 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 {Anchor, Button, H1, Paragraph, Separator, Sheet, Theme, XStack, YStack} from '@slipbox/ui'; | |
import {ChevronDown, ChevronUp} from '@tamagui/lucide-icons'; | |
import {useState} from 'react'; | |
function SheetDemo() { | |
const [open, setOpen] = useState(false); | |
const [position, setPosition] = useState(0); | |
return ( | |
<> | |
<Button |
This file contains 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
require_relative '../node_modules/react-native/scripts/react_native_pods' | |
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | |
platform :ios, '12.4' | |
install! 'cocoapods', :deterministic_uuids => false | |
production = ENV["PRODUCTION"] == "1" | |
target 'Wave' do | |
pod 'Firebase', :modular_headers => true |
This file contains 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
find $1 -name "*.jpg" -exec bash -c $'file="{}"; npx @squoosh/cli --webp \'{"quality":75,"target_size":0,"target_PSNR":0,"method":4,"sns_strength":50,"filter_strength":60,"filter_sharpness":0,"filter_type":1,"partitions":0,"segments":4,"pass":1,"show_compressed":0,"preprocessing":0,"autofilter":0,"partition_limit":0,"alpha_compression":1,"alpha_filtering":1,"alpha_quality":100,"lossless":0,"exact":0,"image_hint":0,"emulate_jpeg_size":0,"thread_level":0,"low_memory":0,"near_lossless":100,"use_delta_palette":0,"use_sharp_yuv":0}\' -d ./output/ "$file"' \; |
This file contains 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
type ReturnTypes<T extends Array<(...a: any[]) => any>> = { | |
[P in keyof T]: T[P] extends (...a: any[]) => infer R ? R : never | |
} |
This file contains 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
from typing import Type, TypeVar | |
T = TypeVar('T', bound='TrivialClass') | |
class TrivialClass: | |
# ... | |
@classmethod | |
def from_int(cls: Type[T], int_arg: int) -> T: | |
# ... |
NewerOlder