Skip to content

Instantly share code, notes, and snippets.

View Kareszrk's full-sized avatar
🏠
Working from home

Karesz Kareszrk

🏠
Working from home
  • Hungary, Budapest
  • 18:41 (UTC +02:00)
View GitHub Profile
@Kareszrk
Kareszrk / serwice-worker.js
Created December 7, 2023 10:55 — forked from hawlik/serwice-worker.js
service worker redirect to browser tab on push notification click event
//browser push notification "onClick" event heandler
self.addEventListener('notificationclick', function(event) {
console.log('[Service Worker] Notification click Received.');
event.notification.close();
/**
* if exists open browser tab with matching url just set focus to it,
* otherwise open new tab/window with sw root scope url
*/
event.waitUntil(clients.matchAll({
@Kareszrk
Kareszrk / variousCountryListFormats.js
Created October 5, 2023 13:39 — forked from incredimike/variousCountryListFormats.js
List of Countries in various Javascript data structures: Alphabetical country lists & Country data objects.
// Lists of countries with ISO 3166 codes, presented in various formats.
// Last Updated: July 30, 2020
// If you're using PHP, I suggest checking out:
// https://github.com/thephpleague/iso3166
// or Laravel: https://github.com/squirephp/squire
//
// JS developers can check out:
// https://www.npmjs.com/package/iso3166-2-db
//