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
| require 'uri' | |
| require 'json' | |
| require 'net/http' | |
| # Create a slack app https://api.slack.com/start | |
| # More information in https://api.slack.com/messaging/sending | |
| ACCESS_TOKEN = '<access token of your app>' | |
| SLACK_URL_POST = 'https://slack.com/api/chat.postMessage' |
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
| Clear-Host | |
| <# | |
| @description: Script que remove os aplicativos padrões do Windows 10 | |
| @author: João Paulo Luiz Lopes | |
| @email.: [email protected] | |
| Retirado de: | |
| https://www.baboo.com.br/tutorial-dicas-windows-10/como-remover-os-apps-padrao-do-windows-10/ |
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.7.1/firebase-app.js"); | |
| importScripts("https://www.gstatic.com/firebasejs/5.7.1/firebase-messaging.js"); | |
| const config = { | |
| messagingSenderId: "<MESSAGING_SENDER_ID>" | |
| } | |
| firebase.initializeApp(config); | |
| const messaging = firebase.messaging(); |
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 messaging = firebase.messaging(); | |
| messaging.onMessage(function(payload) { | |
| if (!("Notification" in window)) { | |
| console.warn("Este navegador não suporta notificações de desktop"); | |
| } else { | |
| const data = JSON.parse(payload.data.notification); | |
| const notification = new Notification(data.title, data); | |
| notification.onclick = function(event) { | |
| event.preventDefault(); |
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 messaging = firebase.messaging(); | |
| function requestToken() { | |
| messaging.getToken().then(function(token) { | |
| console.log("Token:", token); | |
| }).catch(function(error) { | |
| console.error("Um erro ocorreu ao recuperar o token:", error); | |
| }); | |
| } |
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 messaging = firebase.messaging(); | |
| function requestPermission() { | |
| messaging.requestPermission().then(function() { | |
| requestToken(); | |
| }).catch(function(error) { | |
| console.error("Ocorreu um erro ao solicitar permissão:", error); | |
| }); | |
| } |
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
| <script src="https://www.gstatic.com/firebasejs/5.7.1/firebase-app.js"></script> | |
| <script src="https://www.gstatic.com/firebasejs/5.7.1/firebase-messaging.js"></script> |
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 config = { | |
| messagingSenderId: "<MESSAGING_SENDER_ID>" | |
| } | |
| firebase.initializeApp(config); |