This file contains 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
(async function notifyForRate(targetRate) { | |
if (!targetRate) { | |
targetRate = Number(prompt('What is the target rate?')); | |
if (Number.isNaN(targetRate)) { | |
return alert('This is not a number. Cancelling...'); | |
} | |
} | |
if(await Notification.requestPermission() !== 'granted') |
This file contains 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 ExportData (w) { | |
var d = w.document; | |
var base64_encode = w.btoa; | |
var local = base64_encode(JSON.stringify(w.localStorage)); | |
var session = base64_encode(JSON.stringify(w.sessionStorage)); | |
var zone = d.createElement('textarea'); | |
Object.assign(zone.style, { |
This file contains 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
// Avoid `console` errors in production | |
(function() { | |
if(window.debug) { | |
return; | |
} | |
var method; | |
var noop = function () {}; | |
var methods = [ | |
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', |
This file contains 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
// Carrega as dependências | |
var gulp = require('gulp'); | |
var browserSync = require('browser-sync'); | |
var reload = browserSync.reload; | |
// Cria uma tarefa chamada "serve" que vai criar um | |
// servidor e observar mudanças nos arquivos para | |
// atualizar a página automaticamente. | |
gulp.task('serve', function() { | |
This file contains 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
// Cria uma constante chamada configLocal no AngularJS. | |
// Depois ela pode ser injetada como dependência dentro | |
// do projeto. | |
angular | |
.module("nomeDoApp") | |
.constant("configLocal", { | |
"db": "http://localhost", | |
"port": "80", | |
... |