Skip to content

Instantly share code, notes, and snippets.

View m3h0w's full-sized avatar
🖐️

Michał Gacka m3h0w

🖐️
View GitHub Profile
// GW V1.7
// Low power store and forward firmware for GW_v1.x hardware
//#define SHOW_WDT_MSGS
//#define AOUT
#define Serial SerialUSB
#define DEBUG
@m3h0w
m3h0w / firebase-messaging-sw.js
Created December 1, 2020 11:29
Firebase messaging service worker for displaying notifications that lead to the application
importScripts('https://www.gstatic.com/firebasejs/7.18.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/7.18.0/firebase-messaging.js');
const config = {
apiKey: process.env.REACT_APP_FIREBASE_KEY,
authDomain: process.env.REACT_APP_FIREBASE_DOMAIN,
databaseURL: process.env.REACT_APP_FIREBASE_DATABASE,
projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
@m3h0w
m3h0w / index.tsx
Last active December 1, 2020 11:18
Register custom service worker when cra-append-sw operated in dev mode
if ('serviceWorker' in navigator && process.env.NODE_ENV !== 'production') {
console.log('Trying to register custom sw');
navigator.serviceWorker
.register('./firebase-messaging-sw.js')
.then(function (registration) {
console.log('Registration successful, scope is:', registration.scope);
})
.catch(function (err) {
console.log('Service worker registration failed, error:', err);
});
@m3h0w
m3h0w / fcc.claude.monet.tribute
Last active May 26, 2017 07:56
Claude Monet Tribute Page - freeCodeCamp
A simple page created for the assignment for freeCodeCamp course.
------
A [Pen](https://codepen.io/m3h0w/pen/BRbEPb) by [Michał](http://codepen.io/m3h0w) on [CodePen](http://codepen.io/).
[License](https://codepen.io/m3h0w/pen/BRbEPb/license).