aws --endpoint http://localhost:9324 sqs create-queue --queue-name queue-name.fifo --attributes FifoQueue=true,MessageRetentionPeriod=1209600,ContentBasedDeduplication=false
- MessageRetentionPeriod is set to 1209600 seconds which equals to 14 days
import React, { useState } from 'react'; | |
export function App() { | |
const [file, setFile] = useState(null); | |
const handleFileChange = (event) => { | |
setFile(event.target.files[0]); | |
}; | |
const handleSubmit = (event) => { |
# Contrains 1 <= n <= 99 | |
def print_formatted(number: int): | |
width = len(bin(number)[2:]) | |
for n in range(1, number +1): | |
decimal = n | |
octal = oct(n)[2:] | |
hexadecimal = hex(n)[2:].upper() | |
binary = bin(n)[2:] | |
print("{0:>{width}} {1:>{width}} {2:>{width}} {3:>{width}}".format(decimal, octal, hexadecimal, binary, width=width)) |
def mutate_string(string, position, character): | |
string_list = list(string) | |
string_list[position] = character | |
string = "".join(string_list) | |
return string | |
mutate_string("hola", 0, "H") |
def swap_case(text: str): | |
swap = "" | |
for word in text: | |
if word.isupper(): | |
swap += word.lower() | |
continue | |
if word.islower(): | |
swap += word.upper() | |
continue |
students = [['Harry', 37.21], ['Berry', 37.21], ['Tina', 37.2], ['Akriti', 41], ['Harsh', 39]] | |
data_sorted = sorted(students, key=lambda x: x[1]) | |
print(data_sorted) |
const express = require('express'); | |
const fs = require('fs'); | |
const app = express(); | |
const port = 3000; | |
const dotenv = require('dotenv'); | |
const { SQS, SendMessageCommand } = require('@aws-sdk/client-sqs'); | |
const { Consumer } = require('sqs-consumer'); | |
dotenv.config(); |
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: 'AWS::Serverless-2016-10-31' | |
Resources: | |
MyFunction: | |
Type: 'AWS::Serverless::Function' | |
Properties: | |
Handler: index.handler | |
Runtime: nodejs8.10 | |
CodeUri: 's3://my-bucket/function.zip' | |
Policies: |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], | |
"Effect": "Allow", |