Skip to content

Instantly share code, notes, and snippets.

View tkssharma's full-sized avatar
🎯
only JS

codewithtkssharma tkssharma

🎯
only JS
View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deploy
labels:
app: nginx-app
spec:
replicas: 3
template:
.grid-container {
margin-top: 60px;
position: relative;
width: 970px;
margin: auto;
}
.grid-container .grid-columns {
text-align: left;
display: flex;
<div class="grid-container">
<div class="grid-columns">
<div class="grid-column grid-col-4">
<div class="grid-container_column--sagement ui secondary-img ">
<h2>Effective</h2>
<p>Every day hundreds of new ads.</p>
</div>
</div>
<div class="grid-column grid-col-4">
<div class="grid-container_column--sagement ui secondary-img ">
<header class="main-header">
<a href="index.html" class="main-header__brand">
<img src="./images/nanny.png" alt="uHost - Your favorite hosting company">
</a>
<nav class="main-nav">
<ul class="main-nav__items">
<li class="main-nav__item">
<a href="packages/index.html">Account</a>
</li>
<li class="main-nav__item">
html body {
width: 100%;
height: 100%;
margin: 0px;
font-family: 'Roboto', sans-serif;
}
.main-header {
width: 100%;
position: fixed;
workbox.routing.registerRoute(
new RegExp('.css$'),
workbox.strategies.cacheFirst({
cacheName: 'poc-cache-Stylesheets',
plugins: [
new workbox.expiration.Plugin({
maxAgeSeconds: 60 * 60 * 24 * 7, // cache for one week
maxEntries: 20, // only cache 20 request
purgeOnQuotaError: true,
}),
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
return;
}
/* eslint-disable no-undef */
// See https://developers.google.com/web/tools/workbox/guides/configure-workbox
workbox.core.setLogLevel(workbox.core.LOG_LEVELS.debug);
self.addEventListener('install', event => event.waitUntil(self.skipWaiting()));
self.addEventListener('activate', event => event.waitUntil(self.clients.claim()));
workbox.routing.registerRoute(
new RegExp('.css$'),
workbox.strategies.cacheFirst({
{
"name": "react-with-workbox",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"eslint-config-prettier": "^6.1.0",
"prettier": "^1.18.2",
"react": "^16.4.2",
"react-app-rewire-workbox": "^2.0.1",
const {rewireWorkboxInject, defaultInjectConfig} = require('react-app-rewire-workbox');
const path = require('path');
module.exports = function override(config, env) {
if (env === "production") {
console.log("Production build - Adding Workbox for PWAs");
// Extend the default injection config with required swSrc
const workboxConfig = {
...defaultInjectConfig,
swSrc: path.join(__dirname, 'src', 'custom-sw.js')