Skip to content

Instantly share code, notes, and snippets.


Max Rogério max10rogerio

  • Maringá, Paraná - Brasil
View GitHub Profile
max10rogerio / useMedia.js
Created Mar 26, 2020
Hook to verify size screen by param
View useMedia.js
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 / launch.json
Created Mar 20, 2020
Running nodemon with debug and auto-restart
View launch.json
"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 / fix-node-gyp-vs-2019.ps1
Created Mar 6, 2020
Fix node-gyp visual studio 2019
View fix-node-gyp-vs-2019.ps1
This is a workaround for "node-gyp is unable to find msbuild if VS2019 is installed"
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 ( for that:
wsudo powershell -f make-msbuild-shim.ps1
#Requires -RunAsAdministrator
View .releaserc.json
"branch": "master",
"plugins": [
"releaseRules": [
"type": "refactor",
"release": "patch"
max10rogerio / Auth.ts
Created Nov 5, 2019
Problem with Context and directives (Auth)
View Auth.ts
/* 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 /
Last active Apr 3, 2022
Translation of the main messages from the Yup library into the Pt-Br language.
/* eslint-disable */
// For more infos, see:
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}',