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
interface User { | |
id: number; | |
name: string; | |
email: string; | |
password: string; | |
updated_at: Date; | |
} | |
interface Product { | |
id: number; |
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
bradlc.vscode-tailwindcss | |
clinyong.vscode-css-modules | |
dbaeumer.vscode-eslint | |
eamodio.gitlens | |
EditorConfig.EditorConfig | |
esbenp.prettier-vscode | |
glenn2223.live-sass | |
golang.go | |
jock.svg | |
Luisao.one-more-coffee |
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
{ | |
"explorer.confirmDragAndDrop": true, | |
"diffEditor.wordWrap": "on", | |
"editor.fontSize": 18, | |
"editor.insertSpaces": true, | |
"editor.detectIndentation": true, | |
"launch": { | |
"configurations": [] | |
}, | |
"editor.codeActionsOnSave": { |
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
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} | |
html { | |
font-size: 62.5%; | |
} |
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
const user = { | |
name: 'luis' | |
} | |
const messages = { | |
hello: (userName) => `Ola ${userName}, seja bem vindo ao nosso sistema`, | |
goodBye: (userName) => `Até mais ${userName}, esperamos que volte sempre aqui`, | |
} | |
const messagesHandler = { | |
get(target, prop, receiver) { | |
return target[prop](user.name) |
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 from 'react' | |
export const useLocalStorage = <T extends string | object>( | |
item: string, | |
initialValue = '', | |
): [string, React.Dispatch<(value: T) => T>] => { | |
const [localStorageItem, setLocalStorageItem] = React.useState(() => { | |
const itemStoraged = localStorage.getItem(item) | |
if (itemStoraged) { |
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 from 'react' | |
interface IComposeProvidersProps { | |
with: Array<React.ElementType> | |
children: React.ReactNode | |
} | |
export const ComposeProviders = ({ | |
with: Providers, | |
children, |
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
type Diff< | |
Obj1, | |
Obj2, | |
SameKeys extends keyof Obj1 = keyof Obj1 & keyof Obj2 | |
> = Omit<{ | |
[K in (keyof Obj1 | keyof Obj2)]: | |
K extends keyof Obj1 | |
? Obj1[K] | |
: K extends keyof Obj2 | |
? Obj2[K] |
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
type Reverse<A extends string> = | |
`${A}` extends `${infer H}${infer T}` | |
? `${Reverse<T>}${H}` | |
: A |
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
// 00612 - Medium kebabcase | |
type KebabCase<T extends string> = | |
T extends `${infer F}${infer R}` | |
? R extends Uncapitalize<R> | |
? `${Uncapitalize<F>}${KebabCase<R>}` | |
: `${Uncapitalize<F>}-${KebabCase<R>}` | |
: T | |
export type KebabCaseResult = KebabCase<'FooBarBaz'> //foo-bar-baz |
NewerOlder