In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and
returning the cached result when the same
inputs occur again.
— wikipedia
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 AudioRecorderPlayer, { PlayBackType } from "react-native-audio-recorder-player"; | |
import { isIOS } from "utils/utils"; | |
type Callback = (args: { data?: PlayBackType; status: AudioStatus }) => void; | |
type Path = string | undefined; | |
export enum AudioStatus { | |
PAUSED = "PAUSED", | |
PLAYING = "PLAYING", | |
RESUMED = "RESUMED", |
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
/* -------------------------------------------------------------------------- */ | |
/* More here; */ | |
/* -------------------------------------------------------------------------- */ | |
// https://gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15 | |
export function distinctOn<Column extends AnyColumn>(column: Column) { | |
return sql<Column["_"]["data"]>`distinct on (${column}) ${column}`; | |
} | |
export function jsonBuildObject<T extends SelectedFields>(shape: 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 React, {FC} from 'react'; | |
import {Dimensions, StyleSheet, View} from 'react-native'; | |
import { | |
Gesture, | |
GestureDetector, | |
GestureHandlerRootView, | |
} from 'react-native-gesture-handler'; | |
import Animated, { | |
Easing, | |
interpolate, |
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 React, { useRef, useState } from "react"; | |
import { | |
ScrollView, | |
PanGestureHandler, | |
PanGestureHandlerGestureEvent, | |
} from "react-native-gesture-handler"; | |
import Animated, { | |
useAnimatedGestureHandler, | |
useAnimatedStyle, | |
useSharedValue, |
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 AsyncStorage from '@react-native-async-storage/async-storage'; | |
import create from 'zustand'; | |
import { persist } from 'zustand/middleware'; | |
export const useSomthingStore = create<TSomthingStore>( | |
persist( | |
(set, get) => ({ | |
isTrue: false, | |
_hasHydrated: false, | |
setHasHydrated: state => { |
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 "AppDelegate.h" | |
#import "Swift-Header.h" | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication *)application | |
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
LocalNetworkPrivacy *local = [LocalNetworkPrivacy new]; |
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 { writeFileSync } from 'fs' | |
import { map } from 'lodash' | |
import en from './src/localize/en' | |
const lines = map(en, (text, key) => { | |
return `"${key}","${text}"` | |
}) | |
writeFileSync('english.csv', lines.join('\n')) |
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 React, {useRef, useMemo, useState, useCallback} from 'react'; | |
import {Vibration, View, StyleSheet} from 'react-native'; | |
import {Button, Text, Row} from '../../theme'; | |
import {Send as SendIcon} from '../../Icons'; | |
import {useMessage, useConversationEventType} from '../../../redux/msg/hooks'; | |
import Animated, { | |
useAnimatedStyle, | |
useSharedValue, | |
} from 'react-native-reanimated'; | |
import {SwipeRow} from 'react-native-swipe-list-view'; |
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 { Module } from '@nestjs/common' | |
import { AuthService } from './auth.service' | |
@Module({ | |
providers: [AuthService], | |
exports: [AuthService], | |
}) | |
export class AuthModule {} |
NewerOlder