Friday, October 29, 2021
var streetFighter = "Ryu"; function displayFighter() { var streetFighter = "Ken"; console.log(streetFighter); } displayFighter();
Thursday, October 28, 2021
product.name
or with array notation
product["name"]
They both get the job done. However with the array syntax [""] you access the object as if it's an array but instead of accessing it by numbers or index you access it by the property names. That's because JavaScript objects are associative arrays. They look like other objects in other languages such as C, C++, and Java. However they behave very differently.
In other languages objects are defined in advance, their properties are methods are fixed. To add a property or method to the object you have to change the class the object instance is created from.
Wednesday, October 27, 2021
In this post we are going to set up our website to serve up https traffic so that our traffic can be encrypted. In this post the first part of the series we are going to request a certificate from the Certificate Manager in AWS.
1. The first thing we need to do is create a certificate, In the AWS search field search for Certificate Manager then click on the drop down auto complete choice.
Tuesday, October 26, 2021
In this post I am going to show you how to merge an existing branch into a master branch
Here are the steps:
1. First you want to checkout the master branch to work on it with the command git checkout master
Monday, October 25, 2021
First let's create an object that we can work with:
Type in the following code in the between the <script type="text/javascript"></script> tag in an html page.
var product = new Object(); product.name = "Chai"; product.category = "Tea"; product.country = "India"; product.supplier = { name: "ACME Tea Of India", location: "New Delhi" }; console.log(product);If you run the page with the code above you will see the following in the browser console:
Friday, October 22, 2021
If you type the following line as the first line of code in your JavaScript file
var globalObj = this;
What do you think will get? In this case you are referencing the Window object, which is JavaScript's object for the browser window. As you can see there's a whole bunch of global properties and methods already defined at the global level.
Thursday, October 21, 2021
var product = new Object(); product.name = "Chai"; product.category = "Tea"; product.country = "India"; product.supplier = { name: "ACME Tea Of India", location: "New Delhi" };
Let's say another developer works on the project and he assumes that since there's a "country" property that there should be a "city" property. If he tries to access the access the "city" property in the product object he will get an undefined, because the property does not exist. If he types the following he will get the undefined message.
Wednesday, October 20, 2021
In this pose we are going to implement auto scaling on our instances. Auto scaling is a feature on AWS that automatically scaled horizontally either based on metrics or the health of an instance. In this post we are going to setup auto scaling on an Application Load Balancer.
1. The first thing we have to do is setup an Auto Scaling Group under "Auto Scaling" click on "Auto Scaling Groups"
Tuesday, October 19, 2021
First let's create a new branch with the following command in the local git repository
git checkout -b "Hour2"
Now following the tutorials in this post Hour 2: Enable ASP.NET Core to Serve Static Files
After you are done open the command line in the folder and type git add .
Monday, October 18, 2021
Let say you have the following JavaScript code to create a product object.
var product = new Object(); product.name = "Chai"; product.category = "Tea"; product.country = "India"; product.badProperty = "Bad Property"; product.badProperty2 = "Bad Property 2"; product.supplier = { name: "ACME Tea Of India", location: "New Delhi" }; console.log(product);
Friday, October 15, 2021
Thursday, October 14, 2021
Let's say you have an object with a private property $n like the example below:
var game = { $n: "Awesome Game!", get name() { return this.$n} };
The code above only has a getter name that exposes the private property $n when you console.log you should get value of the $n like the code snippet below
Wednesday, October 13, 2021
In the previous post we went over how to create a Application Load Balancer, based on routes in the URL. In this post we are going to change the rules so that it directs traffic based on host names. For example we could have acmebanking.com route to target group 1 and accounts.acmebanking.com route to target group 2. It's the same concept as the previous setup but instead of routes, we are using hostnames instead.
In order to implement this solution we need to setup a record in Route 53, which is AWS domain registration service. You can follow along with the DNS names, but if you have a hostname registered with AWS that's even better.
1. So the first thing you want to do is go to Route 53 dashboard, go to Hosted Zones
Tuesday, October 12, 2021
Here are the steps to create a new repository in github:
1. Log into your github account and click on the "New" button next to the text "Repositories"
Monday, October 11, 2021
The most important thing you have to remember about the grid system is that it divides the page into 12 columns, and it is responsive meaning it will adjust to the size of the client's screen.
You can control the size of the column with the .col-sm, .col-md, .col-lg, .col-xl, which translates to small, medium, large, and extra large screens. In addition to the screen size you can also control the with of the column with the -n at the end of class attribute. For example if you want a column for a small screen to span three columns it would be .col-sm-3.
Here is the cheat sheet, I am going to use color coding for the different sizes.
Small - Green
Medium - Orange
Large - Red
Extra Large - Blue
Friday, October 8, 2021
Thursday, October 7, 2021
while (expression is true)
{
execute these statements
}
The while loop is an iterative loop if the condition is true and the statements are executed, it starts at the top of the loop again and executes until the expression is false. Therefore, there's a potential for an infinite loop.
Wednesday, October 6, 2021
In the previous post we went over how to create a Network Load Balancer, in this post we are going to create one of types of load balancer AWS offers. We are going to create a Application Load Balancer, this balancer is designed to work best with the typical line of business web applications. It deals mostly with the requests/response scenarios on the web, therefore it supports the HTTP, and HTTPS protocols exclusively. It can be setup to respond to the routes that configured or the hosts. It all depends on how your web applications serves the client. In a way it's the easiest load balancer type to understand because it deals with headers, URLs, routes, parameters, query strings and etc.
Before we create the load balancer we need to create more than one instances with a web server because we need to test that the load balancer is able to switch.
1. Create four instances with the user data to create Apache Web Servers with these commands in the User Data for instance, if you need the full instruction on how to create instances with User Data you can read this post .
Tuesday, October 5, 2021
First let's create a git local repository
1. Follow the steps on this blog post to create an empty NorthindCafe in git repository using Visual Studio Hour 1: Create ASP.NET Core Project From Scratch
Monday, October 4, 2021
If we have the code below the countdown displays the same results as the output. However, the first iteration is performed without a evaluation of the expression. It's not until the countdown is 9 that the while part of the loop kicks in.