View index.html
<script>
if (navigator.serviceWorker) {
navigator.serviceWorker.register('./sw.js')
.catch(function(err) {
console.error('Unable to register service worker.', err);
});
}
</script>
View sw.js
workboxSW.router.registerRoute('https://cdnjs.cloudflare.com/(.*)', workboxSW.strategies.staleWhileRevalidate({}), 'GET');
workboxSW.router.registerRoute('https://res.cloudinary.com/dc3dnmmpx/image/upload/(.*)', workboxSW.strategies.staleWhileRevalidate({}), 'GET');
workboxSW.router.registerRoute('https://unpkg.com/(.*)', workboxSW.strategies.staleWhileRevalidate({}), 'GET');
View main.ts
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
CloudinaryModule.forRoot({Cloudinary}, { cloud_name: 'dc3dnmmpx' } as CloudinaryConfiguration)
],
declarations: [AppComponent],
bootstrap: [AppComponent],
View manifest.json
{
"name": "Cloudinary PWA Angular",
"short_name": "Cloudinary PWA",
"lang": "en-US",
"start_url": "/",
"display": "standalone",
"theme_color": "#0e2f5a",
"background_color": "#0e2f5a",
"icons": [
{
View sw.js
importScripts('https://unpkg.com/workbox-sw@2.0.3/build/importScripts/workbox-sw.prod.v2.0.3.js');
const fileManifest = [
{
"url": "manifest.json",
"revision": "df8c1f88f48f4af912acb1e6a8053bfe"
},
{
"url": "cloudinary.png",
"revision": "df8c1f88f48f4af912acb1e6a8053bfe"
View funny.js
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct
View hideHeader.js
$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
$('#menu').css('display', 'none');
} else {
$('#menu').css('display', 'block');
}
});
View ajaxNode.js
var http = require('http');
var server = http.createServer(function (request, response) {
function funcOne(input) {
var request = require('request');
request.get('http://estruturaorganizacional.dados.gov.br/id/unidade-organizacional/1930',
{json: true, body: input},
function(err, res, body) {
if (!err && res.statusCode === 200) {
console.log(err);
View api.js
$.ajax({
method: 'GET',
url: 'https://api.github.com/repos/servicosgovbr/cartas-de-servico/contents/cartas-servico/v3/servicos'
}).then(function(data) {
var servicos = data;
});
View gist:61da14a9e1face560927
setInterval([].forEach.bind($$("*"),function(a){a.style.outline="5px solid #"+(~~(Math.random()*(1<<24))).toString(16) }, 5), 10)