Skip to content

Instantly share code, notes, and snippets.

View n-ii-ma's full-sized avatar
👨‍💻
Coding

Nima n-ii-ma

👨‍💻
Coding
View GitHub Profile
@bradtraversy
bradtraversy / typescript-crash.ts
Last active April 8, 2024 15:07
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@edmondburnett
edmondburnett / gist:38ed3451de659dc43fa3f24befc0073b
Last active July 12, 2023 14:23
Axios Interceptor to delay and retry original request for certain status code (polling)
import axios from 'axios';
const instance = axios.create({
baseURL: 'http://localhost:5000'
});
const sleepRequest = (milliseconds, originalRequest) => {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(instance(originalRequest)), milliseconds);
});