Skip to content

Instantly share code, notes, and snippets.

View Ribeiro-Tiago's full-sized avatar

Tiago Ribeiro Ribeiro-Tiago

View GitHub Profile
@Ribeiro-Tiago
Ribeiro-Tiago / git-branch-prune.txt
Last active May 27, 2021 07:44
prune git branches
// remote prune
git remote prune origin
// local prune
git fetch --all -p; git branch -vv | grep ": gone]" | awk '{ print $1 }' | xargs -n 1 git branch -D
@Ribeiro-Tiago
Ribeiro-Tiago / axios-base-config.ts
Created March 12, 2025 09:54
base configs for axios
import Axios, { AxiosProgressEvent } from "axios";
import nProgress from "nprogress";
import { Store } from "vuex";
import { Router } from "vue-router/auto";
import { version } from "../../package.json";
const globalCancelToken = Axios.CancelToken.source();
// progress bar on top of the page on every axios request.
@Ribeiro-Tiago
Ribeiro-Tiago / request.ts
Created March 12, 2025 09:54
fetch composable for vue
// heavily inspired by nuxt's useFetch
// functionalities:
// - delayed execution
// - result prop picking
// - custom transformer
// - state related callbacks (state change, success, error)
// - auto retry
// - request caching
// - auto fetch based on watched props
// - request dedup