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
'use strict'; | |
exports.handler = async (event, context, callback) => { | |
const response = event.Records[0].cf.response; | |
const headers = response.headers; | |
headers['Strict-Transport-Security'] = [{ | |
key: 'Strict-Transport-Security', | |
value: 'max-age=63072000; includeSubDomains; preload', | |
}]; |
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
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
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
let $photoInput = document.getElementById("input"); | |
let fileReader = new FileReader(); | |
let image = new Image(); | |
let $editor = document.getElementById("editor"); | |
let $editorCtx = $editor.getContext("2d"); | |
//This is a performance test | |
function opacitor(op) { | |
let imgData = $editorCtx.getImageData(0, 0, $editor.width, $editor.height); | |
for (let x = 0; x < image.width; x++) { |
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
let $photoInput = document.getElementById("input"); | |
let image = new Image(); | |
let $editor = document.getElementById("editor"); | |
let $editorCtx = $editor.getContext("2d"); | |
function opacitor(op) { | |
let imgData = $editorCtx.getImageData(0, 0, $editor.width, $editor.height); | |
for (let x = 0; x < image.width; x++) { | |
for (let y = 0; y < image.height; y++) { | |
let index = (x + y * image.width) * 4; |