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
{ | |
"openapi": "3.0.0", | |
"info": { | |
"version": "2.0.0", | |
"title": "API Rest Dynamodb example", | |
"description": "Api Rest example to show the use of dynamodb, and docker-compose", | |
"license": { | |
"name": "Juan Ignacio Paz", | |
"url": "http://www.jipnet.com.ar" | |
} |
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
#!/bin/sh | |
cd /setup | |
# Wait just in case LocalStack delays the start | |
sleep 7s | |
# Create table in DynamoDB | |
aws dynamodb create-table --endpoint-url http://localstack:4569 --cli-input-json file://create-players.json |
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
{ | |
"players": [ | |
{ | |
"PutRequest": { | |
"Item": { | |
"mytype": { | |
"S": "player" | |
}, | |
"myposition": { | |
"S": "defender" |
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
{ | |
"players": [ | |
{ | |
"PutRequest": { | |
"Item": { | |
"mytype": { | |
"S": "player" | |
}, | |
"myposition": { | |
"S": "defender" |
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
{ | |
"players": [ | |
{ | |
"PutRequest": { | |
"Item": { | |
"mytype": { | |
"S": "player" | |
}, | |
"myposition": { | |
"S": "defender" |
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
{ | |
"players": [ | |
{ | |
"PutRequest": { | |
"Item": { | |
"mytype": { | |
"S": "player" | |
}, | |
"myposition": { | |
"S": "forward" |
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
{ | |
"TableName": "players", | |
"AttributeDefinitions": [ | |
{ | |
"AttributeName": "mytype", | |
"AttributeType": "S" | |
}, | |
{ | |
"AttributeName": "myposition", | |
"AttributeType": "S" |
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
function countSmileys(arr) { | |
let count = 0; | |
let validFace = [ | |
":)", | |
";)", | |
":-)", | |
";-)", | |
":~)", | |
";~)", | |
":D", |
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
function countSmileys(arr) { | |
let smiles = 0; | |
let eyes = [";", ":"]; | |
let noses = ["-", "~"]; | |
let mouth = [")", "D"]; | |
for (let i = 0; i < arr.length; i++){ | |
if (arr[i].length == 3){ | |
if (((eyes.indexOf(arr[i][0]) != -1)) && (noses.indexOf(arr[i][1]) != -1) && (mouth.indexOf(arr[i][2]) != -1)){ | |
smiles++; | |
} |
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
// 1. Demonstrate all the different ways to iterate the below array | |
const myArray = [1, 2, 3, 4, 5, 6]; | |
// 2. Demonstrate all the different ways to iterate the keys of | |
// the below object | |
const myObject = { x: 1, y: "hi" }; | |
// 3. Repeat #2, demonstrate different ways to iterate | |
// the values of "myObject" |
NewerOlder