Skip to content

Instantly share code, notes, and snippets.

View gauravbehere's full-sized avatar
🥁

Gaurav gauravbehere

🥁
View GitHub Profile
@gauravbehere
gauravbehere / manifest.json
Last active February 1, 2020 07:12
Sample Manifest File
{
"name": "PWA Starter Demo ",
"short_name": "PWA Demo",
"description": "PWA starter demo with features like sync, push etc",
"start_url": "./index.html?ref=home",
"display": "standalone",
"orientation": "portrait",
"background_color": "#000000",
"theme_color": "#000000",
"icons": [
@gauravbehere
gauravbehere / service-worker.js
Last active February 1, 2020 06:15
Sample Service Worker
// Cache Key (Update this name to update the cache)
var cacheName = 'cache-v3';
/*
* Files to be served from cache
*/
var files = [
'./',
'./css/styles.css',
'./images/icon_16.png',
import { Observable } from 'rxjs/Observable';
const simpleObservable = new Observable(observer => {
setTimeout(() => {
observer.next(1);
}, 2000);
});
simpleObservable.subscribe(value => console.log(value));
@gauravbehere
gauravbehere / promise.js
Last active November 11, 2019 13:52
A Simple Promise
const simplePromise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve(1);
}, 2000);
});
simplePromise.then(res => console.log(res));
@gauravbehere
gauravbehere / package.json
Created August 1, 2019 11:41
Sample package.json
{
"name": "react-tutorials",
"version": "1.0.0",
"description": "React Samples",
"main": "getting-started/index.js",
"scripts": {
"build": "webpack --progress --colors --display-error-details --debug --display-reasons",
"build-watch": "webpack --progress --colors --display-error-details --debug --display-reasons --watch",
"start": "node server.js"
},
@gauravbehere
gauravbehere / webpack.config.js
Last active August 1, 2019 11:17
A sample Webpack config
const path = require('path');
const deployPath = path.resolve(__dirname, './dist');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const webpack = require('webpack');
module.exports = {
entry: './getting-started/index.js',
output: {
path: deployPath,