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
  • 17:19 (UTC +02:00)
View GitHub Profile
@navjotdhanawat
navjotdhanawat / json-to-s3.js
Created July 3, 2018 07:17
Create json and upload to s3 bucket using nodejs.
var AWS = require('aws-sdk');
AWS.config.update({ region: 'us-east-1' });
var s3 = new AWS.S3();
var obj = {
firstname: "Navjot",
lastname: "Dhanawat"
};
var buf = Buffer.from(JSON.stringify(obj));
@hawlik
hawlik / serwice-worker.js
Created January 4, 2017 23:00
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({