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
@matvaleriano
matvaleriano / v-locale-date.ts
Last active February 6, 2023 22:57
custom vue directive to formate date to locale
const DEFAULT_LOCALE = "pt-BR";
/*
* Custom vue directive to format date in text content
*/
function localeDate(el, binding) {
const locale = binding.value || DEFAULT_LOCALE;
el.textContent = new Date(el.textContent).toLocaleDateString(locale);
}
@matvaleriano
matvaleriano / README.md
Created May 15, 2020 21:11 — forked from VitorLuizC/README.md
🌯 Resources about TypeScript implementation of Maybe monad.
@matvaleriano
matvaleriano / imagens.md
Last active April 27, 2020 13:21
Performance com gatsby

Arquivos

Primeiro de tudo vc deve configurar os filesystems do seu projeto através do gatsby-source-filesystem é uma boa nomear de acordo com a necessidade

Como ter performance com imagens no gatsby

Imagens na tela (img)

@matvaleriano
matvaleriano / reactSummary.md
Last active June 5, 2020 23:03
React summary only examples #summary #react #examples

React Resume

Props

Props são atributos que podem ser passados para componentes (não mude eles dentro do component que vc está usando)

Pros are attributes that can be passed to components (don't change them into the component which is using them)

States

A melhor forma de manipular as props que foram passadas e outros atributos do seu component

@matvaleriano
matvaleriano / .git-commit-template.txt
Created January 22, 2019 16:47 — forked from adeekshith/.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
@matvaleriano
matvaleriano / __mocksStore__.js
Created August 8, 2018 12:52
Helpers for Jest + Vue tests
// set this file into the store -> store/__mocks__/index.js
import Vue from 'vue'
import Vuex from 'vuex'
// your mocks
import state from './state'
import * as getters from './getters'
import mutations from './mutations'
import * as actions from './actions'