Serverles.yml Property Description service Will have the properties which describe the service for which the YAML file is for, properties like name, arn… app Name of the app you create service for. App should be created in serverless and name can be found in serverless.com dashboard org Multiple organizations can be created in serverless and this property indicates the organization for which the service is created package Include/Exclude fi...

What is AppSync? AWS AppSync helps you create a flexible API to securely access, manipulate, and combine data from one or more data sources.AppSync uses GraphQL. AppSync can be used along with Amazon services like Lambda, DynamoDB, etc.. What is GraphQL? GraphQL is a language for APIs that enables you to query and manipulate data easily through an intuitive and flexible syntax. GraphQL provides a syntax to describe data requirements and interact...

This tutorial aims at providing basic steps required to create a Lambda which will provide a Presigned URL that can be used to upload an object to the AWS S3 bucket. Upload is tested here with Postman. What is s3 ? Amazon S3 or Amazon Simple Storage Service is a service offered by Amazon Web Services that provides object storage. An object consists of a file and optionally any metadata that describes that file. S3 helps to store the objects in ...

In this tutorial, we will learn to  Create an AWS Lambda function with Node.js as the Runtime environment. Import the function into AWS Cloud9(Cloud9 IDE is an Online IDE). Initialize npm, add dependency moment.js and deploy it.   Step 1 – Create a Lambda. Goto services->Lambda and click Create function Choose Author from scratch, Node.js as Runtime, provide a function name and click Create function [crayon-5f31e609b012b857824485/]...

This tutorial aims at explaining how to read data from the AWS DynamoDB table. AWS SDK has a class AWS.DynamoDB.DocumentClient, which has methods scan, get and query, that are used to read data from the AWS DynamoDB table.  Documentation on various methods provided by the class is available from the following link AWS.DynamoDB.DocumentClient – Documentation.   Table structure primary partition key – name sort key – age tab...

Here are the steps to create an EC2(Amazon Elastic Compute Cloud), set up your Git remote repository in EC2 and connect to the remote repo from your local machine. Some explanations are provided for better understanding. AWS Elastic Compute Service(EC2) is IaaS(Infrastructure as a Service).   PART 1 – Creating and connecting to AWS EC2 Virtual Machine instance.   STEP 1  – Go to AWS console. STEP 2 – goto services, ...



first-child and nth-child selectors : Styling multiple Elements with same class – CSS

first-child  – This selector selects first child of its parent. To color first one of elements with the same class,we use first-child selector.Consider below example with multiple divs(.box)  inside parent div(.container).To change the style of first div [crayon-5f31e6099b61a342525341/]   nth-child – This selector selects nth child of its parent. We can achieve the above result using nth-child selector .The number ...

How to change ‘sql_mode’ in mysql

To see Mysql mode settings,do the following query. Mysql mode is not linked to any particular database. Modes can be set locally to the session (connection), or for the server globally. [crayon-5f31e6099c4c0248525272/] [crayon-5f31e6099c4c7246436488/] This gives results like below   Now to change sql_mode,you need to run query like this [crayon-5f31e6099c4c9120473444/] Example Some times after  importing database and changing some...

Event propagation in javascript – Capturing and Bubbling

Event propagation is the propagation of an event through the elements in the HTML DOM. When an event happens phase1 – Event Capturing is done until the target is reached phase2 –  Bubbling is done executing handlers on the way Event bubbling and capturing are the two ways of event propagation in processing an event by the HTML DOM API.Event bubbling means that when an event happens, it propagates all the way up the parent t...

Closures in JavaScript

A closure is the combination of a function and the lexical environment within which that function was declared. We will take a detailed look in to closures using the following examples. [crayon-5f31e6099e79f959754818/] In this example,you can see that variable a is in Global scope.The variable a is available inside the example() function so that , we don’t have to pass it as an argument to the example() function. Now if you do a c...

What are cookies and how to set and get them with Javascript

Cookies are data stored as text files in the computer.They are used store data that are needed to be remembered , like user information.Cookies can be set in client side and server side. For example,consider a user sign in to your website.The server sends back some response.The response have a token/id that can be stored as a cookie.This cookie value can keep the users details status in the client side. Cookie has a name and value pair,...

Understading working of javascript : Google’s JavaScript V8 Engine

What is javascript? Javascript is a single threaded,aynchrounous,non-blocking concurrent language.If you have an javascript code ,it is run by engines.Javascript v8 Engine powers Node.js ,Chrome browser,Electron(Desktop Application dev).There are many Javascript engines like Chakra(Microsoft), Spidermonkey(Firefox). We focus on V8 Javascript engine to understand more about JavaScript engines here.What V8 basically does is that it genera...

Javascript try,catch and finally : Error handling

When we run Javascript code unexpected errors can happen but how to handle these errors… Handling the errors are necessary for providing a better end user experience and Javascript provides some features to efficiently handles the errors Try statement – Try statement checks for errors in a block of code. Consider the following code,the httpGet function send a Get request to a dummy api [crayon-5f31e6099fdf6012917381/] This s...

An introduction to Eloquent ORM in Laravel

ORM refers to Object Relational Mapping.What ORM tools like  Eloquent does is that they are equipped with a metadata descriptor which helps in connecting object code to a relational database.To learn more on ORM refer this article. https://truetocode.com/orm-using-sequelize-orm-with-express-node-js/418/ Now,we know that sequelize is an ORM tool that is used to connect node applications to relational databases such as Mysql/postgres.Fo...

Persistent data structures,trie and immutable js

If you do not know about immutability read more here http://truetocode.com/understanding-concepts-of-immutables-and-mutables-in-javascript/378/. Immutable data is never changed once it is created.It can prevent unwanted alteration of data and helps us in more efficient programming.Mutability may cause unwanted bugs as the data may get changed accidentally. Consider we have an array that contains the name of fruits say,   [crayon-...

HttpInterceptor in angular with example-Adding token to every request

HttpInterceptor –  feature in Angular 4.3. We may need to intercept Http request while building apps with Angular. Sometimes we may you need to intercept Http request to add something to request header or to do something with the response. We can use Http Interceptor to do some action when sending  a request.This can be achieved using  the following interceptor class which implemenets Httpinterceptor.The interceptor adds an &#...