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
const bodyParser = require('body-parser'); | |
const express = require('express') | |
const port = 3800; | |
const museumData = require('./data.json'); | |
const _ = require('lodash'); | |
const app = express(); | |
app.get("/", (req, res) => { | |
res.send("Hello World!"); |
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
image: docker:19.03.10 | |
services: | |
- docker:dind | |
variables: | |
REPOSITORY_URL: <REPOSITORY_URL> | |
TASK_DEFINITION_NAME: <Task_Definition> | |
CLUSTER_NAME: <CLUSTER_NAME> | |
SERVICE_NAME: <SERVICE_NAME> |
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
$(aws ecr get-login --no-include-email) | |
docker build -t <REPOSITORY_URL> . | |
docker push |
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
FROM node:14.7.0-alpine3.10 | |
WORKDIR /usr/src/app | |
COPY . . | |
RUN npm install | |
EXPOSE 8080 |
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
[ | |
{ "username": "Anita", "email": "anita@gmail.com", "age": 23, "gender": "female", "phone": "9876543210"}, | |
{ "username": "Rakesh", "email": "rakesh@gmail.com", "age": 19, "gender": "male", "phone": "9876543211"}, | |
{ "username": "Vishwa", "email": "vishwa@gmail.com", "age": 26, "gender": "male", "phone": "9876543212"}, | |
{ "username": "Sunita", "email": "sunita@gmail.com", "age": 31, "gender": "female", "phone": "9876543213"}, | |
{ "username": "Vanita", "email": "vanita@gmail.com", "age": 16, "gender": "female", "phone": "9876543214"}, | |
{ "username": "Suman", "email": "suman@gmail.com", "age": 45, "gender": "female", "phone": "9876543215"} | |
] |
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
class Node { | |
constructor(value) { | |
this.value = value; | |
this.next = null; | |
} | |
} | |
class LinkedList { | |
constructor() { | |
this.head = null; |
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
const numbers = [1, 2, 4, 5, 7, 8, 11]; | |
const evenNumbers = numbers.filter(i => i % 2 === 0) | |
const oddNumbers = numbers.filter(i => i % 2 !== 0) | |
// console.log(evenNumbers) returns [2, 4, 8] | |
// console.log(oddNumbers) returns [1, 5, 7, 11] | |
const students = [ | |
{ name: 'prithvi', age: 20, section: 'A' }, | |
{ name: 'shubham', age: 19, section: 'B' }, |
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
const myFilter = (array, callback) => { | |
const newArray = []; | |
array.forEach(element => { | |
if (callback(element)) { | |
newArray.push(element) | |
} | |
}) | |
return newArray; | |
} |
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
const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present']; | |
const bigWords = words.filter(word => word.length > 6); | |
// console.log(bigWords) returns ["exuberant", "destruction", "present"] |
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
// I have an array of numbers, for whom I want to find out their square roots | |
const squares = [1, 4, 9, 16, 25, 36]; | |
const sqrts = squares.map(Math.sqrt); | |
// console.log(sqrts) returns [1, 2, 3, 4, 5, 6] | |
I have another array of numbers, for whom I want their integer parts | |
const numbers = [1.1, 2.4, 3.7, 8, 9.1, 11.2]; | |
const integers = numbers.map(Math.floor) |
NewerOlder