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-safe route parameter parser library with pattern-based type inference | |
| */ | |
| // Template literal type utilities for extracting parameter names from route patterns | |
| type ExtractRouteParams<T extends string> = T extends `${infer _Start}:${infer Param}/${infer Rest}` | |
| ? {[K in Param | keyof ExtractRouteParams<`/${Rest}`>]: string} | |
| : T extends `${infer _Start}:${infer Param}` | |
| ? {[K in Param]: string} | |
| : Record<string, never>; |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Canvas performance</title> | |
| </head> | |
| <body> | |
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
| /* eslint-disable react-native/no-inline-styles */ | |
| import {Canvas, Group, Rect} from '@shopify/react-native-skia'; | |
| import React from 'react'; | |
| import {View, Text} from 'react-native'; | |
| import RNBootSplash from 'react-native-bootsplash'; | |
| import Animated, { | |
| useAnimatedScrollHandler, | |
| useAnimatedStyle, | |
| useDerivedValue, | |
| useSharedValue, |
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 React, { useMemo } from 'react'; | |
| import { useWindowDimensions } from 'react-native'; | |
| import { Canvas, Path, Group, Paragraph, RoundedRect, FitBox, rect, Skia, useFonts } from '@shopify/react-native-skia'; | |
| export const TAIL_PATH = | |
| 'M3.94273 0V6.12112C4.06491 8.02508 3.83039 9.92913 3.19852 11.7719C2.74874 13.0837 2.12094 14.2964 1.34027 15.4016C1.26825 15.5036 1.20493 15.6101 1.15 15.7201C0.747509 16.0979 0.496094 16.6348 0.496094 17.2304C0.496094 18.3741 1.42328 19.3013 2.56701 19.3013C2.66084 19.3013 2.75322 19.2951 2.84374 19.283C2.92254 19.2764 3.00318 19.2642 3.08557 19.2462C9.1064 17.9284 13.7623 14.5866 15.4498 9.66513C16.5144 6.56026 16.2603 3.22681 14.937 0H3.94273Z'; | |
| export const Paragraphs = () => { | |
| const { height, width } = useWindowDimensions(); |
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 {Canvas, RoundedRect} from '@shopify/react-native-skia'; | |
| import React from 'react'; | |
| import {StyleSheet, View} from 'react-native'; | |
| import { | |
| Gesture, | |
| GestureDetector, | |
| GestureHandlerRootView, | |
| ScrollView, | |
| } from 'react-native-gesture-handler'; | |
| import {PanGesture} from 'react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture'; |
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
| // | |
| // ViewController.swift | |
| // ScrollViewInsertTest | |
| // | |
| // Created by Terry Sahaidak on 18.10.2023. | |
| // | |
| import UIKit | |
| class ViewController: UIViewController, UIScrollViewDelegate { |
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 createDebounceAverage( | |
| title: string, | |
| phase: string, | |
| delay: number = 100 | |
| ) { | |
| let values: number[] = []; | |
| let timeout: NodeJS.Timeout; |
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 React, {useRef, useState} from 'react'; | |
| import {FlatList, Image, useWindowDimensions} from 'react-native'; | |
| import {Gesture, GestureDetector} from 'react-native-gesture-handler'; | |
| import Animated, {useSharedValue} from 'react-native-reanimated'; | |
| // array of 3 images | |
| const images = [ | |
| {id: 1, url: 'https://picsum.photos/id/237/200/300'}, | |
| {id: 2, url: 'https://picsum.photos/id/238/200/300'}, | |
| {id: 3, url: 'https://picsum.photos/id/239/200/300'}, |
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
| const KeyboardAvoidingView = (props) => { | |
| const behavior = props.behavior; | |
| const keyboard = useAnimatedKeyboard(); | |
| const insets = useSafeAreaInsets(); | |
| const animatedStyle = useAnimatedStyle(() => { | |
| const value = keyboard.height.value - insets.bottom; | |
| if (behavior === 'height') { |
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 React, {useEffect} from 'react'; | |
| import {StyleSheet, View} from 'react-native'; | |
| import {map, mapValues} from 'lodash'; | |
| function execute(fn) { | |
| const start = global.performance.now(); | |
| fn(); | |
| const end = global.performance.now() - start; | |
| return end; |
NewerOlder