Skip to content

Instantly share code, notes, and snippets.

@hoshomoh
hoshomoh / workbox.md
Created Sep 21, 2020 — forked from addyosmani/workbox.md
Workbox recipes
View workbox.md

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 / .htaccess
Created Mar 16, 2020 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#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 / unlfs.bash
Created Jul 7, 2019
Revert GIT LFS files from repository
View unlfs.bash
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
You can’t perform that action at this time.