View yup.locale.pt-br.js
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
/* eslint-disable */ | |
// For more infos, see: https://github.com/jquense/yup/blob/master/src/locale.js | |
import { setLocale } from 'yup' | |
const translation = { | |
mixed: { | |
default: '${path} é inválido', | |
required: '${path} é um campo obrigatório', | |
oneOf: '${path} deve ser um dos seguintes valores: ${values}', | |
notOneOf: '${path} não pode ser um dos seguintes valores: ${values}', |
View Auth.ts
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
/* eslint-disable no-underscore-dangle */ | |
// This is a example of my|problem | |
import { SchemaDirectiveVisitor } from 'graphql-tools' | |
import { GraphQLField, defaultFieldResolver, GraphQLResolveInfo } from 'graphql' | |
export interface UserToken { | |
id: number | |
instituicao?: number |
View .releaserc.json
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
{ | |
"branch": "master", | |
"plugins": [ | |
[ | |
"@semantic-release/commit-analyzer", | |
{ | |
"releaseRules": [ | |
{ | |
"type": "refactor", | |
"release": "patch" |
View fix-node-gyp-vs-2019.ps1
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
<# | |
This is a workaround for "node-gyp is unable to find msbuild if VS2019 is installed" | |
https://github.com/nodejs/node-gyp/issues/1663 | |
It create a shim EXE as "MSBuild\15.0\Bin\MSBuild.exe" to target "MSBuild\Current\Bin\MSBuild.exe" | |
By noseratio - MIT license - use at your own risk! | |
It requires admin mode, I use wsudo/wsudox (https://chocolatey.org/packages/wsudo) for that: | |
wsudo powershell -f make-msbuild-shim.ps1 | |
#> | |
#Requires -RunAsAdministrator |
View launch.json
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "nodemon", | |
// path to nodemon inside your project | |
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/nodemon", | |
// script to initialize the server |
View useMedia.js
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 { useEffect, useState } from 'react'; | |
/** | |
* Exemple of sizes: | |
* mobile: '(min-width: 425px)' | |
* tablet: '(min-width: 768px)' | |
* laptop: '(min-width: 1024px)' | |
* @param {String} size | |
* @returns {boolean} | |
*/ |
View mimes.json
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
{ | |
"aac": "audio/aac", | |
"abw": "application/x-abiword", | |
"arc": "application/x-freearc", | |
"avi": "video/x-msvideo", | |
"azw": "application/vnd.amazon.ebook", | |
"bin": "application/octet-stream", | |
"bmp": "image/bmp", | |
"bz": "application/x-bzip", | |
"bz2": "application/x-bzip2", |
View clipboard.ts
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
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard | |
/** | |
* Interface CopyToClipboard params | |
*/ | |
interface ICopyToClipboard { | |
/** HTML reference identifier ```<div id="foo"></div>``` */ | |
target?: string; | |
/** String value */ | |
value?: string; |
View template-literal-type.ts
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 Example { | |
first_name: string, | |
last_name: string, | |
home_town: string, | |
} | |
type CamelizeString<T extends PropertyKey> = T extends string ? string extends T ? string : | |
T extends `${infer F}_${infer R}` ? `${F}${Capitalize<CamelizeString<R>>}` : T : T; | |
type Camelize<T> = { [K in keyof T as CamelizeString<K>]: T[K] } |
View slugify.ts
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
// ref: https://gist.github.com/codeguy/6684588#gistcomment-3426313 | |
export const slugify = (...args: (string | number)[]): string => { | |
const value = args.join(' ') | |
return value | |
.normalize('NFD') // split an accented letter in the base letter and the acent | |
.replace(/[\u0300-\u036f]/g, '') // remove all previously split accents | |
.toLowerCase() | |
.trim() |
OlderNewer