This file contains hidden or 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
| class Err<E> { | |
| constructor(public error: E) {} | |
| } | |
| export function err<E>(err: E): Result<never, E> { | |
| return new Err(err); | |
| } | |
| export function isErr<T, E>(value: Result<T, E>): value is Err<E> { | |
| return value instanceof Err; |
This file contains hidden or 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
| #!/bin/bash | |
| TARGET_AVD_NAME=$1 | |
| for id in $(adb devices | grep emulator | cut -f1); do | |
| name=$(adb -s $id emu avd name | head -1 | tr -d '\r') | |
| if [ "$name" = "$TARGET_AVD_NAME" ]; then | |
| echo "$id" | |
| break | |
| fi |
This file contains hidden or 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 type { UuidString } from "@/src/uuid"; | |
| import type { | |
| PostgrestSingleResponse, | |
| SupabaseClient, | |
| } from "@supabase/supabase-js"; | |
| import type { ReadonlyDeep } from "type-fest"; | |
| import type { SupabaseDatabase, TablesInsert, TablesUpdate } from "./types"; | |
| export type PublicTableName = keyof SupabaseDatabase["public"]["Tables"]; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
| } |
NewerOlder