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
import * as cdk from "aws-cdk-lib"; | |
import * as cloudfront from "aws-cdk-lib/aws-cloudfront"; | |
import * as origins from "aws-cdk-lib/aws-cloudfront-origins"; | |
import * as acm from "aws-cdk-lib/aws-certificatemanager"; | |
import { ApplicationStack, ApplicationStackProps } from "./application"; | |
export function createCDN( | |
stack: ApplicationStack, | |
props: ApplicationStackProps | |
) { |
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
// https://spoofing.medium.com/deploying-a-cloudfront-waf-with-typescript-and-aws-cdk-e35df6d7d00c | |
import * as cdk from "aws-cdk-lib"; | |
import * as wafv2 from "aws-cdk-lib/aws-wafv2"; | |
import { aws_opensearchservice as opensearchservice } from "aws-cdk-lib"; | |
import { aws_kinesisfirehose as kinesisfirehose } from "aws-cdk-lib"; | |
import { aws_s3 } from "aws-cdk-lib"; | |
import * as ec2 from "aws-cdk-lib/aws-ec2"; | |
import * as secretsmanager from "aws-cdk-lib/aws-secretsmanager"; | |
import * as logs from "aws-cdk-lib/aws-logs"; | |
import { RetentionDays } from "aws-cdk-lib/aws-logs"; |
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
import * as cdk from "@aws-cdk/core"; | |
import * as wafv2 from "@aws-cdk/aws-wafv2"; | |
// This extends the base cdk stack properties to include a tag name input. | |
export interface StackProps extends cdk.StackProps { | |
tag: string; | |
applicationName?: string; | |
} | |
export class WAFStack extends cdk.Stack { |
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
export const removeSpecialCharacters = (str?: string) => { | |
return str | |
?.replace(/[ÀÁÂÃÄÅ]/g, 'A') | |
.replace(/[àáâãäå]/g, 'a') | |
.replace(/[ÈÉÊË]/g, 'E') | |
.replace(/[^a-z0-9]/gi, ' '); | |
}; | |
export const getNameInitials = (name?: string) => { | |
const initials = name?.match(/\b(\w)/g); |
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
const data = [ | |
{ transactionStatus: 'PROCESSING', date: '2021-12-26T09:40:50', brand: 'MASTERCARD', transactionType: 'CREDIT', value: 500000,}, | |
{ transactionStatus: 'RECEIVED', date: '2021-12-26T10:12:41', brand: 'MASTERCARD', transactionType: 'CREDIT', value: 500000,}, | |
{ transactionStatus: 'CANCELED', date: '2021-12-26T10:12:41', brand: 'MASTERCARD', transactionType: 'CREDIT', value: 500000,}, | |
{ transactionStatus: 'CANCELED', date: '2021-12-27T12:35:23', brand: 'MASTERCARD', transactionType: 'CREDIT', value: 500000,}, | |
]; | |
const groups = data.reduce((groups, sale) => { | |
const time = sale.date.split('T')[0]; |
- Open the terminal and run the code below:
$ cat ~/.ssh/id_rsa.pub
- Copy the generated code, as example:
ssh-rsa AAADDDB3NzaC1yc2EAAAADAQABAAACAQDYEuGZGyrJZZW8+IsZhvbi4Mb/1alI8g6HCyxLBrL0EikwLVnskKSgDH2/t+Uayyf3jPJbV4lnG3ciKHAZZvuiXkh80YvrO+BxmAbWSZvk3ppcsypsYi+4T5cbJX5f3h5jfpYOhR1cNw1bj23jIBA6VEQgVFWMGA4vEomOc1AkHI5WUveGb/TSg1Zl5Q+4jIKaHfIRfE+Ykymaxp/TSol9lrrUUmhHngQmMVDEBI0NAIt60lkO4wBB2xvRLDTxKScXe2OPQ7YMG+trIPKQH2M8uS3fyc0wWwhOYx20OXc4bpiLLvoOOjFLWL26GBQgmST7NZeU83QcMuFCMMlhsfrCWJjYlghhrfWVWJezTJghJWiW2fpfqjJIYrtI2umNgZywxPWTebMo07fGLZHr5Dc4NWbPDzN+PtUmpE+lxHp68KlOun6eh+xEzuPIAxhpGV/bwjH9MeDlj9YMAgzhJy/ORM/S/CmI7pLVZR/mUD8IB4qbo7hePf5WCyWzyG98BGmkKlHyM+Lb5QotW8d+fDIm1NqObG5btzY5b15N/9VJXQkt8OVtc7StuXcWFj3Xyq300msLb+E/cF1ZX185Rn4pqYJH0OCCGCZXTtUo6MjZybWFskZVR5bJs0++13RfM0ruhY7Bvr3Yt7IySxp8AR6Yw1ZL5k4qt31HkyWvOf3k5w== [email protected]
var houses = [1, 0, 0, 0, 0, 1, 0, 0];
var days = 1;
function cellCompete(state, days){
if(state.length > 8 || days < 1){
return false;
}
var currentIndex, previousValue, nextValue;