Skip to content

Instantly share code, notes, and snippets.

View itsprofcjs's full-sized avatar
🎯
Focusing

Rupesh Kumar Singh itsprofcjs

🎯
Focusing
View GitHub Profile
@itsprofcjs
itsprofcjs / fetch with retry and backoff
Last active November 3, 2024 01:36
Rxjs http fetch call with retry and backoff feature
import { fromFetch } from 'rxjs/fetch';
import { catchError, delay, mergeMap, retryWhen, switchMap } from 'rxjs/operators';
import { from, Observable, of, throwError } from 'rxjs';
const retryWithBackOff = (delayMs: number = 0, maxRetry: number = 0, backOffMs: number = 0) => {
let currentRetries = maxRetry;
return (source: Observable<any>) =>
source.pipe(
retryWhen((error: Observable<any>) =>
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name website;
root /srv/sites/website;
# index.html fallback
location / {
try_files $uri $uri/ /index.html;
}
Open ~/.p10k.zsh, search for POWERLEVEL9K_SHORTEN_STRATEGY and change the value of this parameter to truncate_to_last
Alternatively, you can try changing the value of POWERLEVEL9K_DIR_MAX_LENGTH to 1.