Skip to content

Instantly share code, notes, and snippets.

View AsbDaryaee's full-sized avatar

Amir H. Moayeri AsbDaryaee

View GitHub Profile
@mberneti
mberneti / retryDynamicImport.ts
Last active November 11, 2024 05:32
This utility function retryDynamicImport enhances React’s lazy loading mechanism by adding retry logic with a versioned query parameter. It retries importing a component multiple times in case of failure, which can be useful for bypassing browser cache or dealing with intermittent network issues. It can be used as a drop-in replacement for React…
// Usage:
// Replace React.lazy(() => import('x'));
// with retryDynamicImport(() => import('x'));
import { ComponentType, lazy } from 'react';
const MAX_RETRY_COUNT = 15;
const RETRY_DELAY_MS = 500;
// Regex to extract the module URL from the import statement
@szemate
szemate / package-lock-conflicts.md
Last active December 26, 2024 10:42
How to resolve package-lock.json conflicts

How to resolve package-lock.json conflicts

It is not possible to resolve conflicts of package-lock.json in GitHub's merge tool and you need to do a manual merge.

  1. Update the master branch with the latest changes:
    git checkout master
    git pull
    
  2. Merge your feature branch into master:
@qti3e
qti3e / README.md
Last active December 12, 2024 06:11
List of file signatures and mime types based on file extensions
@hal0gen
hal0gen / _mobile-ready-web-app.html
Last active January 4, 2025 18:35 — forked from tfausak/ios-8-web-app.html
iOS + Android settings for web applications
<!doctype html>
<!-- Adapted from https://gist.github.com/tfausak/2222823 -->
<html>
<head>
<title>Mobile-ready web app</title>
<!-- CONFIGURATION -->