Skip to content

Instantly share code, notes, and snippets.

View max10rogerio's full-sized avatar
🎯
Focusing

Max Rogério max10rogerio

🎯
Focusing
  • Maringá, Paraná - Brasil
View GitHub Profile
@max10rogerio
max10rogerio / useMedia.js
Created March 26, 2020 15:09
Hook to verify size screen by param
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}
*/
@max10rogerio
max10rogerio / launch.json
Created March 20, 2020 12:21
Running nodemon with debug and auto-restart
{
"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
@max10rogerio
max10rogerio / fix-node-gyp-vs-2019.ps1
Created March 6, 2020 18:31
Fix node-gyp visual studio 2019
<#
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
{
"branch": "master",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"type": "refactor",
"release": "patch"
@max10rogerio
max10rogerio / Auth.ts
Created November 5, 2019 13:20
Problem with Context and directives (Auth)
/* 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
@max10rogerio
max10rogerio / yup.locale.pt-br.js
Last active August 23, 2023 17:43
Translation of the main messages from the Yup library into the Pt-Br language.
/* 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}',