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
<html> | |
<body> | |
<button onclick="aml()">test aml</button> | |
<button onclick="eurazeo()">test eurazio</button> | |
<script> | |
history.pushState("", "", "/"); | |
</script> | |
<script> | |
function submitRequest(url) { | |
var xhr = new XMLHttpRequest(); |
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 NodeClam = require('clamscan'); | |
module.exports = async function scanFile(filePath) { | |
console.log(`Attempting virus scan for ${filePath}`); | |
const clamscan = await new NodeClam().init({ | |
remove_infected: true, | |
debug_mode: false, | |
scan_recursively: false, |
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 * as fileType from 'file-type'; | |
const MIN_FILE_SIZE = 0; | |
const MAX_FILE_SIZE = Number.MAX_SAFE_INTEGER; | |
const ALLOWED_FILE_MIMETYPES: string[] = []; | |
function validateFileSize(file: File): boolean { | |
return file.size >= MIN_FILE_SIZE && file.size <= MAX_FILE_SIZE; | |
} | |
function validateFileMimetype(file: File): Promise<boolean> { |
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 { | |
UpdateCounterPartyRisk, | |
UpdateAssetCounterPartyRisk, | |
UpdateCounterPartyRiskWithAlerts, | |
UpdateAssetCounterPartyRiskWithAlerts, | |
UpdateDDCounterPartyRisk, | |
UpdateHitStatus, | |
UpdateBatchStatus, | |
} = require("@schemas/grid"); | |
const axios = require("axios"); |
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
export const getThumbnail = (id, size = 300) => | |
`https://drive.google.com/thumbnail?id=${id}&sz=${size}`; | |
export const getIcon = (mimeType) => | |
`https://drive-thirdparty.googleusercontent.com/256/type/${mimeType}`; | |
export const getFile = (id) => `https://drive.google.com/uc?id=${id}`; | |
const downloadFile = (id) => |
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
export function validURL(string) { | |
const pattern = new RegExp( | |
"^(https?:\\/\\/)?" + // protocol | |
"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain name | |
"((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address | |
"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path | |
"(\\?[;&a-z\\d%_.~+=-]*)?" + // query string | |
"(\\#[-a-z\\d_]*)?$", | |
"i" | |
); // fragment locator |
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
//Original Reference: https://guseyn.com/posts/simple-jwt | |
function payloadWithExpirationTime (payload, minutesFromNow) { | |
let date = new Date() | |
date.setMinutes(date.getMinutes() + minutesFromNow) | |
payload.exp = date.getTime() | |
return payload | |
} | |
NewerOlder