Skip to content

Instantly share code, notes, and snippets.

View pmatsinopoulos's full-sized avatar
💻
Programming

Panos Matsinopoulos pmatsinopoulos

💻
Programming
View GitHub Profile
/*********************************************************************************************
* Returns a copy of "input" without the characters that exist inside the "setOfCharacters".
* It does the work in a case insensitive mode.
* Example: "Hello World!" with "setOfCharacters" being "oe", returns "Hll Wrld!".
*
* @param input
* @param setOfCharacters
* @returns String
*/
function squeeze(input, setOfCharacters) {
describe('squeeze function', function () {
context('when string is "Hello World!" and set of characters is "oe"', function () {
var input = "Hello World!";
var setOfCharacters = "oe";
var result = "Hll Wrld!";
it('should return "' + result + '"', function () {
expect(squeeze(input, setOfCharacters)).toBe(result);
});
});
/*********************************************************************************************
* Returns a copy of "input" without the characters that exist inside the "setOfCharacters".
* It does the work in a case insensitive mode.
* Example: "Hello World!" with "setOfCharacters" being "oe", returns "Hll Wrld!".
*
* @param input
* @param setOfCharacters
* @returns String
*/
function squeeze(input, setOfCharacters) {
context = describe;
describe('squeeze function', function () {
context('when string is "Hello World!" and set of characters is "oe"', function () {
var input = "Hello World!";
var setOfCharacters = "oe";
it('should return "Hll Wrld!"', function () {
var result = "Hll Wrld!";
expect(squeeze(input, setOfCharacters)).toBe(result);
});
resource "aws_cloudwatch_log_group" "s3_sink_msk_connector" {
name = "${var.project}-s3-sink-msk-connector"
tags = {
"environment" = var.environment
"Name" = "${var.project}-cloudwatch-log-group-for-s3-sink-msk-connector"
"project" = var.project
}
}
{
"title": "Practical Terraform & AWS"
}
@pmatsinopoulos
pmatsinopoulos / client_machine.tf
Created February 3, 2023 08:39
Practical Terraform & AWS - Part 8 - Client Machine
data "aws_ami" "client" {
most_recent = true
filter {
name = "architecture"
values = ["x86_64"]
}
filter {
name = "block-device-mapping.delete-on-termination"
@pmatsinopoulos
pmatsinopoulos / live_listening_event_consumer_ecs.tf
Created February 3, 2023 08:37
Practical Terraform & AWS - Part 8 - Live Listening Event Consumer ECS
resource "aws_iam_role" "ecs_task_execution" {
name = "${var.project}-ECSTaskExecRole"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow",
Principal = {
Service = "ecs-tasks.amazonaws.com"
@pmatsinopoulos
pmatsinopoulos / variables.tf
Created February 3, 2023 08:35
Practical Terraform & AWS - Part 8 - Variables
variable "company_name" {
type = string
description = "This is going to be used as a prefix before the project name for resources that require a global naming uniqueness, like S3."
nullable = false
}
variable "project" {
type = string
description = "The name of this project, like 'msk-demo' will be used as prefix name accross many resources."
default = "msk-demo"