Skip to content

Instantly share code, notes, and snippets.

View matvaleriano's full-sized avatar
:shipit:
I may be slow to respond.

Mat matvaleriano

:shipit:
I may be slow to respond.
View GitHub Profile
@sibelius
sibelius / useSWReg.tsx
Created May 26, 2020 11:57
use Service Worker Registration hook
import firebase from 'firebase/app';
import 'firebase/messaging';
import { useEffect, useRef } from 'react';
import config from '../config';
import firebaseConfig from './firebaseConfig';
import { PushTokenAddMutation } from './__generated__/PushTokenAddMutation.graphql';
import { PushTokenAdd, USER_PUSHENDPOINT_TYPE } from './PushTokenAddMutation';
@VitorLuizC
VitorLuizC / useDontOpenFileOnDrop.ts
Last active February 4, 2020 12:03
A React Hook that prevents browser to open file when drop it.
import { useEffect, useCallback } from 'react';
/**
* React Hook that prevents the browser from opening files when a user drops
* files on the screen. It doesn't affect component specific drag-and-drop
* behavior since it prevents the default behavior of bubbled events on the
* higher instance (Window).
*/
const useDontOpenFileOnDrop = () => {
const handleDrop = useCallback((event: DragEvent) => {
import * as Yup from 'yup'
import { cep } from 'utils/textMask'
import { TextInput } from 'components'
import { AddressService } from 'services'
import removeMask from 'utils/removeMask'
const _fillAddress = async (inputProps: Record<string, any>) => {
const { value: zipCode, setFieldValue } = inputProps
const response = await AddressService(removeMask(zipCode))
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
extends: [
'react-app',
'airbnb',
'plugin:@typescript-eslint/recommended',
@VitorLuizC
VitorLuizC / README.md
Last active November 19, 2022 12:46
🌯 Resources about TypeScript implementation of Maybe monad.
@balataca
balataca / index.spec.js
Last active December 12, 2018 10:49
Test method inside Vuejs mounted lifecycle hook with Jest
import { mount } from '@vue/test-utils'
import Component from '.'
describe('Component', () => {
describe('mounted', () => {
let wrapper
let spy
beforeEach(() => {
spy = jest.spyOn(Component.methods, 'methodToMock')
wrapper = mount(Component)
@adeekshith
adeekshith / .git-commit-template.txt
Last active September 18, 2024 15:59 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@rxaviers
rxaviers / gist:7360908
Last active September 20, 2024 17:33
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: