Skip to content

Instantly share code, notes, and snippets.

View hvchien216's full-sized avatar
🎯
Focusing

Chien Lewis hvchien216

🎯
Focusing
  • Ho Chi Minh City
View GitHub Profile
import axios, { AxiosRequestConfig } from 'axios';
import { store } from 'index';
// actions
import { setLoading } from 'redux/actions';
type IConfig = AxiosRequestConfig & {
showSpinner?: boolean;
};
@hvchien216
hvchien216 / images_dimensions.go
Created November 23, 2022 03:53 — forked from sergiotapia/images_dimensions.go
Golang - Getting the dimensions of an image. jpg, jpeg, png
package main
import (
"fmt"
"image"
"os"
_ "image/jpeg"
_ "image/png"
)
@hvchien216
hvchien216 / files.sh
Created November 17, 2022 15:18 — forked from schollz/files.sh
Go upload/recieve files via POST
#! /bin/bash
for n in {1..100}; do
dd if=/dev/urandom of=file$( printf %d "$n" ).bin bs=1 count=$(( RANDOM + 1024 ))
done
@hvchien216
hvchien216 / axios.refresh_token.1.js
Created October 27, 2022 04:19 — forked from Godofbrowser/axios.refresh_token.1.js
Axios interceptor for refresh token when you have multiple parallel requests. Demo implementation: https://github.com/Godofbrowser/axios-refresh-multiple-request
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@hvchien216
hvchien216 / multiple_ssh_setting.md
Last active May 10, 2022 09:56 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"