Skip to content

Instantly share code, notes, and snippets.

View manjunathgk22's full-sized avatar
💭
I may be slow to respond.

manjunathgk22

💭
I may be slow to respond.
View GitHub Profile
@manjunathgk22
manjunathgk22 / pubsub.js
Created June 4, 2019 05:51 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@manjunathgk22
manjunathgk22 / index.html
Created May 28, 2019 11:32 — forked from arikanmstf/index.html
Service Worker Communication
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"/>
<meta name="google" content="notranslate"/>
<meta name="msapplication-tap-highlight" content="no"/>
<meta http-equiv="cache-control" content="no-store"/>
<meta http-equiv="expires" content="0"/>
@manjunathgk22
manjunathgk22 / webpack.config.js
Created December 13, 2017 09:22 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"