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 Routes = { | |
a: { | |
string: string | |
} | |
b: undefined | |
} | |
type NullableKeys<T, K extends keyof T> = T[K] extends null | undefined | |
? K |
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 fs = require('fs'); | |
const english = require("./english.json").text | |
const portuguese = require("./portuguese.json").text | |
const DEFAULT_KEY = "en-US" | |
const accumlator = {} | |
// Acc the english ones | |
english.reduce((all, value) => { | |
all[value.key] = { |
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 from 'react'; | |
import { | |
createAppContainer, | |
createStackNavigator | |
} from 'react-navigation' | |
import TestScreen, { | |
testScreenOptions | |
} from './TestScreen' | |
const stack = createStackNavigator({ |
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
// This is basically a copy of | |
// https://github.com/nysamnang/react-native-raw-bottom-sheet | |
// but using only translate animations instead of height | |
import React, { | |
forwardRef, ReactNode, | |
RefForwardingComponent, | |
useImperativeHandle, | |
useState | |
} from 'react' |
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, { | |
Children, | |
cloneElement, FC, useRef, useState | |
} from 'react' | |
import { | |
Animated, | |
TouchableHighlight, | |
View, | |
ViewStyle | |
} from 'react-native' |
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
{ | |
"pageCount": 1, | |
"result": [ | |
{ | |
"page_number": 12, | |
"is_favorite": true, | |
"cover": { | |
"width": 40, | |
"height": 50, | |
"url": "www.test.com" |
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
/* | |
* This is micro optimized, you could | |
* do it without mutability, but I think | |
* that this is to solve a very specific case (apollo | |
* requires __typename to be injected) | |
*/ | |
function addTypeNames( | |
item: object, | |
typeNames: object | |
) { |
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
export type Primitive = string | number | boolean | bigint | symbol | undefined | null; | |
export type PickKeysDeep<T, P = any> = { | |
[K in keyof T]: T[K] extends object | |
? P extends Primitive | |
? PickKeysDeep<T[K], P> | |
: K | PickKeysDeep<T[K], P> | |
: P extends Primitive | |
? P extends T[K] | |
? K |
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
// Let's suppose you have this in adb: | |
const adbCommands = `input tap 450 450 | |
input tap 740 280 | |
input tap 683 614 | |
input tap 950 411 | |
input tap 1188 248 | |
input tap 915 713 | |
input tap 1176 560 | |
input tap 1428 358 | |
input tap 1149 789 |