Skip to content

Instantly share code, notes, and snippets.

View someonewithpc's full-sized avatar

Hugo Sales someonewithpc

View GitHub Profile
@joakimriedel
joakimriedel / !typed mappers (mapGetters, mapActions, mapMutations, mapState) for vuex 4 and vue 3.md
Last active May 9, 2024 14:40
Strictly typed mappers for vuex 4 and vue 3 using Typescript 4.4+

Vuex 4 is a great companion to Vue 3, but Vuex is falling behind on Typescript support. While waiting for better typing support in Vuex 5 or using Pinia, this wrapper might help.

Using this wrapper will correctly infer arguments and return types on your state, actions, getters and mutations.

It works both within your store(s) and any Vue components where you use the mapActions, mapState, mapGetters or mapMutations helpers from Vuex.

No more any will help you find many errors at compile-time!

@TheSherlockHomie
TheSherlockHomie / RenewExpiredGPGkey.md
Created January 3, 2021 16:36
Updating expired GPG keys and backing them up 🔑🔐💻

Updating expired GPG keys and their backup 🔑🔐💻

I use a GPG key to sign my git commits.

An error like this one might be a sign of an expired GPG key.

error: gpg failed to sign the data fatal: failed to write commit object
@kborovik
kborovik / How to use a GPG key for SSH authentication
Created October 8, 2020 12:28
How to use a GPG key for SSH authentication
# How to use a GPG key for SSH authentication
# Tested on Ubuntu 20.04 LTS
# Enable SSH support in gpg-agent:
echo enable-ssh-support > ~/.gnupg/gpg-agent.conf
# Cache GPG & SSH passwords for 24 hours (the reboot will clear the password cache)
echo max-cache-ttl 86440 >> ~/.gnupg/gpg-agent.conf
echo max-cache-ttl-ssh 86440 86440 >> ~/.gnupg/gpg-agent.conf
echo default-cache-ttl 86440 >> ~/.gnupg/gpg-agent.conf