Skip to content

Instantly share code, notes, and snippets.

@hoshomoh
hoshomoh / unlfs.bash
Created July 7, 2019 12:04
Revert GIT LFS files from repository
git lfs ls-files | cut -d ' ' -f 3 > lfs-files.txt
while read file; do
git lfs untrack "$file";
git rm --cached "$file";
git add --force "$file";
done <lfs-files.txt
@hoshomoh
hoshomoh / .htaccess
Created March 16, 2020 06:44 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@hoshomoh
hoshomoh / workbox.md
Created September 21, 2020 21:28 — forked from addyosmani/workbox.md
Workbox recipes

Workbox runtime caching recipes

Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:

importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();

// Placeholder array populated automatically by workboxBuild.injectManifest()
@hoshomoh
hoshomoh / axios-retry.js
Last active October 6, 2022 09:29
Retries
const retryRequest = (config) => {
config.retry -= 1;
const delayRetryRequest = new Promise((resolve) => {
setTimeout(() => {
resolve();
}, config.retryDelay || 1000);
});
return delayRetryRequest.then(() => instance(config));