This file contains hidden or 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
| function pivot(arr, start=0, end=arr.length + 1) { | |
| function swap(array, i, j) { | |
| var temp = array[i]; | |
| array[i] = array[j]; | |
| array[j] = temp; | |
| } | |
| var pivot = arr[start]; | |
| var swapIdx = start; |
This file contains hidden or 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
| const inventors = [ | |
| { first: 'Albert', last: 'Einstein', year: 1879, passed: 1955 }, | |
| { first: 'Isaac', last: 'Newton', year: 1643, passed: 1727 }, | |
| { first: 'Galileo', last: 'Galilei', year: 1564, passed: 1642 }, | |
| { first: 'Marie', last: 'Curie', year: 1867, passed: 1934 }, | |
| { first: 'Johannes', last: 'Kepler', year: 1571, passed: 1630 }, | |
| { first: 'Nicolaus', last: 'Copernicus', year: 1473, passed: 1543 }, | |
| { first: 'Max', last: 'Planck', year: 1858, passed: 1947 }, | |
| { first: 'Katherine', last: 'Blodgett', year: 1898, passed: 1979 }, | |
| { first: 'Ada', last: 'Lovelace', year: 1815, passed: 1852 }, |
This file contains hidden or 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
| exports.createDog = functions.firestore | |
| .document('dogs/{dogId}') | |
| .onCreate(event => { | |
| var dog = event.data(); | |
| console.log(dog.comment); | |
| axios.post(`https://fcm.googleapis.com/fcm/send`,{ | |
| "to" : "/topics/general", | |
| "priority" : "high", |
This file contains hidden or 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
| module.exports = { | |
| pwa: { | |
| // configure the workbox plugin | |
| workboxPluginMode: 'InjectManifest', | |
| workboxOptions: { | |
| swSrc: "src/firebase-messaging-sw.js" | |
| } | |
| } | |
| } |
This file contains hidden or 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
| importScripts('https://www.gstatic.com/firebasejs/5.6.0/firebase-app.js'); | |
| importScripts('https://www.gstatic.com/firebasejs/5.6.0/firebase-messaging.js'); | |
| self.__precacheManifest = [].concat(self.__precacheManifest || []); | |
| workbox.precaching.suppressWarnings(); | |
| workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); | |
| workbox.routing.registerRoute( | |
| new RegExp('https://firebasestorage.googleapis.com/v0/b/cropchien.appspot.com/.*'), | |
| workbox.strategies.staleWhileRevalidate() |
This file contains hidden or 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
| { | |
| "to" : "/topics/general", | |
| "priority" : "high", | |
| "notification" : { | |
| "title" : "Cropchien", | |
| "body" : "Notification test :)", | |
| "click_action": "http://localhost:8081", | |
| "icon": "http://localhost:8081/chrome/chrome-installprocess-128-128.png" | |
| } | |
| } |
This file contains hidden or 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
| <template> | |
| <v-app> | |
| <v-toolbar app> | |
| <v-btn | |
| icon v-if="$route.name !== 'home'" | |
| @click="$router.go(-1) " | |
| > | |
| <v-icon>arrow_back</v-icon> | |
| </v-btn> | |
| <v-toolbar-title > |
This file contains hidden or 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 firebase from 'firebase/app' | |
| import 'firebase/firestore'; | |
| import 'firebase/messaging'; | |
| import 'firebase/storage'; | |
| const config = { | |
| apiKey: "####", | |
| authDomain: "####", | |
| databaseURL: "####", | |
| projectId: "####", |
This file contains hidden or 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
| module.exports = "[PASTE_YOUR_SERVER_KEY_HERE]"; |
This file contains hidden or 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
| const functions = require('firebase-functions'); | |
| const admin = require('firebase-admin'); | |
| const axios = require('axios'); | |
| var cors = require('cors') ({origin:true}); | |
| const serverKey = require('./serverKey'); | |
| admin.initializeApp(functions.config().firebase); | |
| let firestore = admin.firestore() | |
| exports.GeneralSubscription = functions.https.onRequest((request, response) => { |
NewerOlder