This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body{ | |
text-align: center; | |
} | |
.counterSetter{ | |
box-shadow: 0px 2px 25px 0 rgba(17, 17, 24, 0.12); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cacheName = "IMAGE_CHACHE"; | |
self.addEventListener('install', (event) => { | |
console.log('service worker installed successfully '); | |
}); | |
self.addEventListener('fetch', (event) => { | |
let requestURl = new URL(event.request.url); | |
if(!requestURl.pathname.endsWith('.gif')) { | |
//return if the request is not a gif file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path') | |
module.exports = { | |
entry: "./src/calculator.js", | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
filename: "calculator.bundle.js" | |
}, | |
module: { | |
rules: [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calculator { | |
constructor(a, b) { | |
this.a = a; | |
this.b = b; | |
} | |
add() { | |
return this.a + this.b | |
} | |
subtract() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EventEmitter from 'wolfy87-eventemitter' | |
//Create a instance for event emitter | |
const Event = new EventEmitter() | |
class Parent_1-Component extends Component{ | |
componentDidMount(){ | |
// Emit welcome message to grant child component without passing it through | |
// via child component. | |
Event.emit('Greet', "Hello Raja"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
class Greeting extends Component { | |
constructor(props) { | |
super(props); | |
// you can see the onGreet function we passed from App component to this component | |
// in props | |
console.log('Greeting props are ', props); | |
} | |
componentDidMount() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"users": { | |
"uid_0": { | |
"name": "user1", | |
"profileUrl": "sdfs", | |
"contacts": { | |
"uid_1": { | |
"conversation":"con_0", | |
"status":"active" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spawn = require('child_process').spawn; | |
wifiNetworksRSSI(function(err, data, raw) { | |
if (!err) { | |
console.log(data); // formatted data with SSID, BSSID, RSSI | |
// console.log(raw); // raw output from netsh | |
} else { | |
console.log(err); | |
} | |
}); |
NewerOlder