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
// Caso queira gerar planilhas use array na var. conteudo | |
let conteudo = 'Conteúdo que estará dentro do arquivo'; | |
let nomeArquivo = 'Nome do arquivo + .extensão'; | |
var blob = new Blob([conteudo], { type: 'text/csv;charset=utf-8;' }); | |
if (navigator.msSaveBlob) { // IE 10+ | |
navigator.msSaveBlob(blob, nomeArquivo); | |
} else { | |
var link = document.createElement("a"); |
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
import { environment } from 'src/environments/environment'; | |
if (environment.production) { | |
if (location.protocol === 'http:') { | |
location.href = location.href.replace('http', 'https'); | |
} | |
} |
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
// Bootstrap version 4 | |
function detectSizeBootstrapGrid() { | |
let envs = ['xs', 'sm', 'md', 'lg', 'xl']; | |
// Create element to get name size | |
let el = document.createElement('div'); | |
document.body.appendChild(el); | |
let size = envs.shift(); |
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
const app = express(); | |
const forceSSL = function() { | |
return function(req, res, next) { | |
if (req.headers["x-forwarded-proto"] !== "https") { | |
return res.redirect(["https://", req.get("Host"), req.url].join("")); | |
} | |
next(); | |
}; | |
}; |
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
import { getYear } from 'date-fns'; | |
getDaysInMonth(month): Array<number> { | |
const date = new Date(getYear(new Date()), month, 1); | |
const days = []; | |
while (date.getMonth() === month) { | |
days.push({ name: new Date(date).getDate() }); | |
date.setDate(date.getDate() + 1); | |
} | |
return days; |