Skip to content

Instantly share code, notes, and snippets.

@barna2019
barna2019 / relatedpost.html
Created May 13, 2020 11:58
relatedpost.html
<!DOCTYPE html>
<HTML dir='ltr' lang='en-US'>
<head>
<meta content='width=device-width,minimum-scale=1,initial-scale=1' name='viewport'/>
<meta charset='utf-8' />
<title>Related Post</title>
<style>
body {
<!DOCTYPE html><HTML dir='ltr' lang='id-ID'><head><meta charset='utf-8'/><title>Related Post</title><style>*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Roboto","Segoe UI","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif}body li,body ul{margin:0;float:left}body li{list-style-type:none!important;display:inline;line-height:1em;width:100%;border-bottom:1px solid #d7d7d7;padding:10px 0}body ul{padding:0}span.news-text{font-size:14px;color:#666;line-height:1.2em}body ul li a{text-decoration:none;display:block;color:#000;transition:all .2s ease;font-weight:500;line-height:1.3em}body ul li:hover a.relinkjdulx{color:#2962ff}body ul li img{float:left;margin-right:10px;padding:0;border-radius:3px}.relinkjdulx{font-size:17px;margin-bottom:5px}@media only screen and (max-width:600px){span.news-text{display:none}}</style></head><body><ul><script>function getQueryVariable(r){for(var l=window.location.search.substri
@barna2019
barna2019 / amp-web-push-permission-dialog.html
Created May 16, 2020 23:42
amp-web-push-permission-dialog.html
<!doctype html>
<html>
<!-- AMP Web Push Permission Dialog -->
<head>
<meta charset="utf-8">
<!-- Do not edit styles in this section -->
<style builtin>
'use strict';
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function() {
// Update 'version' if you need to refresh the cache
var staticCacheName = 'static';
var version = 'v1::';
<!doctype html>
<html>
<head>
<title>installing service worker</title>
<script type="text/javascript">
var swsource = "https://gist.githubusercontent.com/barna2019/e9c2d4d2e1548f52b08304ef69bce2eb/raw/bcad9d0b8f938c05e3d508663d02f4dd6e196667/serviceworker.js";
if("serviceWorker" in navigator) {
navigator.serviceWorker.register(swsource).then(function(reg){
console.log('ServiceWorker scope: ', reg.scope);
}).catch(function(err) {
@barna2019
barna2019 / amp-web-push-helper-frame.html
Created July 20, 2020 10:44
amp-web-push-helper-frame.html
<!doctype html>
<html>
<!-- AMP Web Push Helper IFrame -->
<head>
<meta charset="utf-8">
<script>(function(){var f;function g(a){for(var b=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global],c=0;c<b.length;++c){var d=b[c];if(d&&d.Math==Math)return d}return function(){throw Error("Cannot find global object");}()}var h=g(this);function k(a,b){b=void 0===b?"":b;try{return decodeURIComponent(a)}catch(c){return b}};var l=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;var n=self.AMP_CONFIG||{},p=("string"==typeof n.cdnProxyRegex?new RegExp(n.cdnProxyRegex):n.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function r(a){if(self.document&&self.document.head&&(!self.location||!p.test(self.location.origin))){var b=self.document.head.querySelector('meta[name="'+a+'"]');b&&b.getAttribute("content")}}n.cdnUrl||r("runtime-host");n.geoApiUrl||r("amp-geo-api");self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:n
@barna2019
barna2019 / amp-web-push-permission-dialog.html
Created July 20, 2020 10:46
amp-web-push-permission-dialog.html
<!doctype html>
<html>
<!-- AMP Web Push Permission Dialog -->
<head>
<meta charset="utf-8">
<!-- Do not edit styles in this section -->
<style builtin>
@barna2019
barna2019 / amp-web-push.service-worker.js
Created July 20, 2020 10:49
amp-web-push.service-worker.js
/**
* Copyright 2017 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
{
"name": "AMP PWA CODING",
"short_name": "PRASADAM",
"description": "Get in touch. Send an email at prasadam.2012@gmail.com; Follow on fast_n_feast @twitter and BarnaliDutta-IndianCuisine @youtube for authentic Indian food and Bengali recipes.",
"start_url": "./?source=pwa",
"scope": ".",
"background_color": "#005f99",
"theme_color": "#009987",
"display": "standalone",
"orientation": "portrait-primary",
{
"name": "Lyrical Lyghtning",
"short_name": "LyLy",
"description": "All amp pwa code",
"start_url": "https://prasadam-code.blogspot.com/",
"background_color": "#005f99",
"theme_color": "#009987",
"display": "standalone",
"orientation": "portrait-primary",
"lang": "en-US",