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 diff = (arr1, arr2) => [ | |
...arr1.filter(e => !arr2.includes(e)), | |
...arr2.filter(e => !arr1.includes(e)) | |
]; | |
const sym = (...args) => [...new Set(args.reduce(diff))]; | |
sym([1, 2, 3], [5, 2, 1, 4]); | |
// =========================== |
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 existingOrder = [{ | |
CreatedDate: "2021-07-12T03:49:57.000Z" | |
}, | |
{ | |
CreatedDate: "2021-07-13T09:25:23.000Z" | |
}, | |
{ | |
CreatedDate: "2021-07-18T04:52:41.000Z" | |
}, | |
{ |
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 existingOrder = [{ | |
CreatedDate: "2021-07-12T03:49:57.000Z" | |
}, | |
{ | |
CreatedDate: "2021-07-13T09:25:23.000Z" | |
}, | |
{ | |
CreatedDate: "2021-07-18T04:52:41.000Z" | |
}, | |
{ |
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
name: TeardownBranch | |
'on': [delete] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: |
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' | |
const AWS = require("aws-sdk"); | |
const S3 = new AWS.S3(); | |
module.exports = async function (inputs, context) { | |
// example encoded images can be created here: https://www.base64-image.de/ | |
// upload image to S3 | |
try { | |
const s3BucketLocation = await uploadImageToS3(inputs.DeviceDiagnosticRequest.IMEIImage, "IMEIImage", inputs, context); | |
} catch (error) { |
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' | |
// use the following online tool for encryption and decryption testing | |
// https://www.javainuse.com/aesgenerator | |
const CryptoJS = require('crypto-js'); | |
class EncryptionService { | |
/** | |
* Encrypts a plain-text string using AES-256 cipher with the following settings | |
* Mode: CBC, Key Size: 256, Output Format: Base64 |
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 missingIDs = ['111111', '2222222']; | |
const existingUsers = [{ | |
"System": "Test", | |
"Company Name": "Test Company", | |
"UU_UserName": "testuser", | |
"Active": 0, | |
"Ceased": 0, | |
"Unused": 4, | |
"UBO Surname1": "Test", | |
"UBO Firstname1": "Test", |
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 testArr1 = ['pig', 'fox', 'zebra'] | |
const testArr2 = ['ferrari', 'fox', 'pig', 'maserati'] | |
// each value of a Set needs to be unique, so combining arrays that have | |
// duplicate entries into a Set will auto-remove exact matches | |
const removeArrayDuplicates = (first, second) => { | |
const combinedArrays = [...first, ...second]; | |
const arraySet = [...new Set(combinedArrays)] | |
return arraySet | |
} |
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
Most frequently used Docker commands: | |
----------------------------------------------------------------- | |
ALL CONTAINERS - delete | |
----------------------------------------------------------------- | |
## Main ways to remove all images/containers | |
docker rm $(docker ps -a -q) | |
docker rmi -f $(docker images -q) | |
## Delete all running and stopped containers | |
docker container rm -f $(docker ps -aq) |
NewerOlder