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
class MimeType { | |
private static final MimetypesFileTypeMap MIMETYPES_FILE_TYPE_MAP = createMap(); | |
/** | |
* @return a vastly improved mimetype map | |
*/ | |
private static MimetypesFileTypeMap createMap() { | |
try (InputStream is = MimeType.class.getClassLoader().getResourceAsStream("mimetypes.txt")) { | |
return new MimetypesFileTypeMap(is); |
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
# Generate a new key | |
openssl genrsa -out server.key 2048 | |
# Generate a new CSR | |
openssl req -sha256 -new -key server.key -out server.csr | |
# Check certificate against CA | |
openssl verify -verbose -CApath ./CA/ -CAfile ./CA/cacert.pem cert.pem | |
# Self Signed |
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
// works for all browsers | |
async function supportsWebp():Promise<boolean> { | |
const img = new Image(); | |
return new Promise(resolve => { | |
img.onload = function () {resolve((img.width > 0) && (img.height > 0));}; | |
img.onerror = function () {resolve(false);}; | |
img.src = "data:image/webp;base64," + "UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"; | |
}); | |
} |
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
package org.simplejavamail.sslhelper; | |
import org.simplejavamail.internal.util.MiscUtil; | |
@SuppressWarnings("SameParameterValue") | |
public class KeyStoreInfo { | |
private final String keyStorePath; | |
private final String password; | |
private final String type /*= "JKS"*/; |
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> | |
document.addEventListener("DOMContentLoaded", function() { | |
sortChildnodes(document.documentElement); | |
function sortChildnodes(ele) { | |
if (ele.append) { | |
ele.childNodes.forEach(sortChildnodes); | |
var allList = [...ele.childNodes]; | |
var sortList = allList.filter(checkSortCondition); |
OlderNewer