Skip to content

Instantly share code, notes, and snippets.

@katsimoto
katsimoto / index.ts
Last active June 23, 2022 01:21
TypeScript Tools
// https://medium.com/javascript-in-plain-english/powerful-typescript-tools-e1c7875fbb71
type KeysToUnion<T> = keyof T;
type KeysToValue<T> = T[KeysToUnion<T>]
type KeysToTuple<T> = KeysToUnion<T>[]
type OmitPartial<T, K extends keyof T> = Omit<T, K> & {
[Key in K]?: T[Key]
@katsimoto
katsimoto / index.ts
Created June 23, 2022 01:20
Console methods
// https://towardsdev.com/console-log-and-his-ninja-pals-4fc0863ad5f4
// The count method can be used to display the number of times this message was shown on screen.
console.count(label);
// Instead of opening each and looking into them, we can have a flat tabular representation.
console.table([
{ column1: 'row1', column2: 'row1' },
{ column1: 'row2', column2: 'row2' },
]);
import WebView from 'react-native-webview';
import React from 'react';
export const Tips = () => {
const name = 'John Doe';
const phoneNumber = '+72025550139';
const amount = 100;
const uri = `https://pay.cloudtips.ru/a/borodach?name=${name}&sales=390&phone=${phoneNumber}&hidecomment=true${amount ? `&amount=${amount}` : ''}`
return (