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
<?php | |
# Put this function in the main directory of your project | |
# Logs the messages in the php error log file | |
function log_write($logMsg, $printR = false, $useNewLines = true) { | |
$debug = debug_backtrace(); | |
$file = str_replace(dirname(__FILE__), '', $debug[0]['file'] ?? ''); | |
$line = $debug[0]['line'] ?? 'NULL'; | |
$addition = ''; |
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 dataUrlToFileSync(dataUrl, fileName) { | |
var mimeType = dataUrl.substring( | |
dataUrl.indexOf(":") + 1, | |
dataUrl.indexOf(";") | |
); | |
var arr = dataUrl.split(","); | |
var b64str = atob(arr[1]); | |
var n = b64str.length; | |
var u8arr = new Uint8Array(n); | |
while (n--) { |
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
{"lastUpload":"2020-04-28T07:21:57.595Z","extensionVersion":"v3.4.3"} |
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
{"lastUpload":"2020-04-28T07:31:29.315Z","extensionVersion":"v3.4.3"} |
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
var calculateBase64Size = function (base64, mimeType){ | |
var b64Length = base64.length; | |
var base64Padding = 0; | |
if (base64.substring(b64Length - 1) === '=') base64Padding = 1; | |
else if (base64.substring(b64Length - 2) === '==') base64Padding = 2; | |
b64Length = base64.length - ('data:' + mimeType + ';base64,').length; | |
return (b64Length / 4) * 3 - base64Padding; | |
}; |
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
$(".layers-container").sortable({ | |
placeholder: "layer-empty", | |
containment: "parent", | |
tolerance: "pointer", | |
cursor: "grabbing", | |
}) | |
.disableSelection(); | |
var instance = $(".layers-container").data("ui-sortable"); | |
instance.__createHelper = instance._createHelper; |
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
var mapNumberToRange = function (num, in_min, in_max, out_min, out_max) { | |
return (((num - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min) || out_min; | |
} | |
var maxNum = function (arr) { | |
return Math.max.apply(null, arr); | |
} | |
var minNum = function (arr) { | |
return Math.min.apply(null, arr); | |
} | |
var sumArray = function (arr, key) { |