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
// source: https://stackoverflow.com/a/58967523/14569745 | |
openssl genrsa -out key.pem && \ | |
openssl rsa -pubout -in key.pem -out pubkey.pem | |
// Use the content of pubkey.pem as value of PublicKey.PublicKeyConfig.EncodedKey on CloudFront:CreatePublicKey |
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 {CloudFormation} from "aws-sdk"; | |
import { | |
ListStackResourcesOutput, | |
ListStacksOutput, | |
Stack, | |
StackResourceSummary, | |
StackStatus, | |
StackSummary | |
} from "aws-sdk/clients/cloudformation"; |
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
/** | |
* Detect file extension from filename | |
* @param filename | |
* @param extension including the dot | |
*/ | |
export class ExtensionDetector { | |
constructor() { | |
} | |
/** |
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
/** | |
* Validator of file extensions | |
*/ | |
export class ExtensionValidator { | |
private readonly detector = new ExtensionDetector(); | |
constructor() { | |
} | |
/** |
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
Casing: | |
Long: easier to read throug in lists | |
MACRO_CASE: constants, enums | |
kebap-case: file names, paths | |
Short: less characters allow us to fit more meaning; e.g. when we extend or scope an entity (both good practices) the name tends to grow | |
camelCase: variables, function/method names, function/method attributes, GraphQL actions, API I/O, object properties | |
PascalCase for classes and interfaces, cloud infrastructure resource names |
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
SpeechSynthesisResult { | |
privResultId: '2C0AD04069BF42C0BB57C946D66665BA', | |
privReason: 10, | |
privErrorDetails: undefined, | |
privProperties: undefined, | |
privAudioData: ArrayBuffer { | |
[Uint8Contents]: <52 49 46 46 f8 25 05 00 57 41 56 45 66 6d 74 20 10 00 00 00 01 00 01 00 44 ac 00 00 88 58 01 00 02 00 10 00 64 61 74 61 d4 25 05 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 337308 more bytes>, | |
byteLength: 337408 | |
}, | |
privAudioDuration: 38250000 |