teleren/devto huggingface dataset:
Channels in Octopus Deploy
Tags: devops, octopusdeploy
Published: 2022-10-23 19:17:16

Lets say there are 2 code branch and their associated pipelines for Continous Integration- 

1. Regular branch for current release
2. future branch for future release [New]

You may have 2 different agile teams working on each of the above branches.  
So obiviously for the future branch code we had to provision another set of parallel infrastructure for DEV, QA and UAT

Now comes the tricky part for implementing the Octopus deploy part for the second parallel infra.

Initial analysis may suggest we have to duplicate the existing project, variables, steps etc. But this is bruteforce method, the correct way to implement such a scenario is by using channels in Octopus deploy.

Its a very interesting that the team at Octopus already knew such a situation might occur where we start duplicating projects and creating a mess. Hence they introduced the neat and clean way to accomplish this.

Step 1: Create a new Lifecycle
Step 2: Go to Project > Deployments > Channels
Step 3: Add a new channel, associate it with lifecycle created in step 1.
Step 4: Create a version rule that is applicable to this channel**

**The way the channel works is when a new artifact is created in azure artifactory, it checks for the revision number.  
Based on version rule defined in the channel it determines which channel processes the new artifact.

> Octopus Deploy Documentation can be found at [Octopus Channels]: https://octopus.com/docs/releases/channels
Is JavaScript a Synchronous or Asynchronous Language?
Tags: javascript, node, runtime, v8
Published: 2022-10-23 19:11:31


As obvious as the answer might seem to some, explaining why it is synchronous might be difficult. To others, it might be confusing, as it is evident that you can perform both synchronous and asynchronous calls with JavaScript.

Here is a simple explanation that might come in handy when trying to explain the difference.

Pondering on this, I figure the answer to this question lies in the question below.

What is the Difference Between a Javascript Engine and a Javascript Runtime Environment?

A Javascript engine is simply a program or software that interprets and executes Javascript code. There are different engines for different browsers. Chrome uses the v8 engine , Firefox uses SpiderMonkey, etc.

A Javascript runtime environment executes Javascript code as well as other tasks such as call stacks, heaps, and event loops.

As some may be aware, the browser acts as a runtime environment for JavaScript, allowing it to perform asynchronous tasks. Functions such as setTimeOut, alert, and prompt are not native to Javascript; they are contained in the browser window object, and because the Javascript engine cannot interpret these functions , they are related to the browser API ( window object).

I should mention that Node is also a Javascript runtime environment because it uses Node bindings to libuv to call functions that are not executable by the Javascript Engine outside the browser.

So, to return to the original question, is JavaScript a synchronous language? Javascript is, indeed, a synchronous language.
So, how are asynchronous operations carried out? It makes use of the Runtime Environment Libraries to perform asynchronous operations.
I love helping new developers
Published: 2022-10-23 19:07:03

There, I said it.

I love spending time helping and taking the journey with new developers. I'll never understand why so many seasoned 'pros' complain about having to show new developers things.

To me, it's time well spent helping someone get started. And having fun along the way celebrating that excitement and sense of adventure that we all had when we first started the journey.

If I can help someone avoid some of the pitfalls I made along the way then even better, others should be able to learn from the pain and frustration I suffered. If it wasn't for folks helping me out, I might never of made it.

So in many ways, I owe the pay it forward and do so with joy and a passion to get the next generation on the path to success.

Just a Sunday thought, thanks for reading.
CSS Precedence
Tags: css, html
Published: 2022-10-23 18:47:40

Have you ever wondered how many places we can define css?  
We usually define 
- in a separate css file, 
- occassionally inline as well  

but which one takes the precedence when we have styles defined in multiple places which target the same behaviour.  
Ideally its best to define all css in one place but in real world it may not happen that way so in this short but productive post I highlight the precedence of css(starting with the highest order of precedence)-

- !Important styles  

` li{
    list-style-type: none !important;
}`
- Inline styles  

`<a style="color: blue;"  aria-current="page" href="#">Home</a>`
- Id attribute styles  

`#myHeader {
  background-color: lightblue;
  color: black;
  padding: 40px;
  text-align: center;
}`
- class styles  

`<a class="nav-link text-black" href="#">Home</a>`

> when 2 css classes are used and if both happen to define the same behaviour then the last css style takes precedence
Quickstart to Amplication
Tags: api, javascript, docker, programming
Published: 2022-10-23 18:33:38

## Introduction to Amplication

Have you ever wanted to not have to repeatedly code Node.js Backends?
Did you want a Low-code Platform to do that?
Well, Amplication does exactly that!

Instantly Generate: 

- GraphQL APIs, 
- Microservices, 
- REST APIs, 
- Authentication, 
- Authorization, 
- Admin UI 

Amplication is a flexible open-source Node.js app development platform. It helps you build production-ready Node.js backend without wasting time on repetitive coding.


![Amplication Features](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89sqkl9pwe0qhisvo2or.png)

![What do you get from Amplication](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bmvxjibx3awojmuahhlj.png)

## Setting Up Amplication

Requirements:

- Docker
- Node.js
- NPM 
- Github Account

Login to Amplication by Github


![Starter backend Config](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s76fyojxiepm1pqe6y02.png)

Select these configurations for your starter Project

Order management is a sample app by Amplication that contains some entities on creation.

Once you create your service you should see this:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxigdhngenwl5zgv6iei.png)

Amplication uses some popular technologies as you can see

Next click the amplication logo to get directed to the home page.

So there's 4 components Workspace, Project, Service, Message Broker

Service is basically what you created so you can create that multiple times in a project

You can create a project to store multiple services

Now, we need to link a github repo to our project so we go into Project Settings -> Github and Authorize your github account, nextly link it!
(Note: Do not keep the repo empty)

After that, Let's merge our starter service into the Github repo, 
In the right side of your screen, Press the commit changes button, A PR should generate in your repo!

Approve the PR, and the service should be in your github repo! There will be 2 folders: server & admin-ui

You can then download the github repo, and you can follow the README.md in the server to set it up!


Video Version: https://www.youtube.com/watch?v=VCU1hOnSA6k


# Conclusion
Amplication helps you create Node.js backends really easily

Lastly, before you leave, don't forget to key in your feedback in the Comments section below and show some love by dropping a LIKE on this article.
Some Most Used NFT Standards
Tags: blockchain, nft, solidity, programming
Published: 2022-10-23 18:20:38

ERC721 is the basic standard used to build token known as NFT(non-fungible token). A Non-Fungible Token (NFT) is used to identify something or someone in a unique way. This type of Token is perfect to be used on platforms that offer collectible items, access keys, lottery tickets, numbered seats for concerts and sports matches, etc.

There are multiple standards used to build a nft tokens, the most popular are:

1. ERC-721
2. ERC-721A
3. ERC-1155

## ERC721
ERC721 token standard actually started off the NFT phenomenon. The standard was a first of its own kind and helped in creating unique tokens.

ERC721 with ERC721Enumerable extension enhances the functionality of the original ERC721 by adding enumerability of all token ids in the contracts, and a way to check all token ids owned by an account.

**Pros:**

- Makes easy to find tokens by their associated tokenID by adding some utility functions like totalSupply, tokenByIndex, and tokenOfOwnerByIndex.

**Cons:**
- Store redundant/unneeded information on-chain. which drives up the costs of not only minting tokens but also transferring them
- Managing increasingly large loops.
- Mint price cost increase after the first mint

## ERC-721A
ERC721A is an improved implementation of the ERC721 standard that supports minting multiple tokens for close to the cost of one. You can save up to 80% on mints if you use this NFT minting contract

**Pros:**
- Gas savings for minting multiple NFTs in a single transaction.
- Removing duplicate storage from OpenZeppelin’s ERC721Enumerable.
- Updating the owner’s balance once per batch mint request, instead of per minted NFT.
- Updating the owner data once per batch mint request, instead of per minted NFT.

**Cons:**
- Transfer transactions cost more gas, which means it may cost more to gift or sell an ERC721A NFT after minting.

## ERC-1155
ERC-1155 a standard interface for contracts that manage multiple token types, ERC1155 NFT is the same as an ERC721 NFT when the allowed mint quantity is equal to ‘1’. The most notable aspect is the difference between ERC 1155 and ERC 721 focuses largely on support for batch transfers.

**Pros:**
- Facilitate batch transfers, reducing network congestion and lowering gas costs by up to 90%. 
- Has a transfer security function that enables hassle-free transactions and allows tokens to be reclaimed by the issuer if sent to the wrong address.
- Requires a single smart contract for infinite tokens

**Cons:**
- The sole disadvantage of ERC-1155 is that it keeps less reliable data to save time and money on transactions. 

**Which one do you use or prefer to use to build an NFT Token and why🤔?**

I hope you found this article useful, if you need any help please let me know in the comment section. Would you like to buy me a coffee, You can do it [Here](https://www.buymeacoffee.com/abdulmaajid)

Let's connect on [Twitter](https://twitter.com/MrAMaajid) and [LinkedIn](https://pk.linkedin.com/in/amaajid007).
React: Passing props from Child to Parent (alternative method for callbacks).
Tags: javascript, react, tutorial, webdev
Published: 2022-10-23 18:19:01

Props in React are used to pass data between components. This could be from parent to child or from child to parent. In this article, we will look at passing props from child to parent.

The usual or well-known method is pass a callback function as a prop from the parent to the child and update the state in parent component by calling the callback function in the child component.

Instead of that method let's use a hook to pass props from child to parent. To demonstrate this let's say we have a input and when user update the input we call and endpoint with the user entered input value.

```js
// Parent Component
const Main = () => {
  const { inputValue, render } = useInput();

  // Make the api call using the inputValue

  return (
    <div>
      <p>{inputValue}</p>
      {render}
    </div>
  );
};

// useInput Hook
const useInput = () => {
  const [inputValue, setInputValue] = useState('');
  return {
    inputValue,
    render: (
      <div>
        <input
          value={inputValue}
          onChange={e => setInputValue(e.target.value)}
        />
      </div>
    )
  };
};
```
Here the `useInput` hook handles the `inputValue` state and also it handles the rendering (UI) part of the input as well. In the parent component I have destruct the `inputValue` and `render` form the `useInput` hook and use those values to render the UI and make the api call with `inputValue`.

Instead of keeping the `inputValue` state in the parent component and pass the `inputValue` and `setInputValue` as props to a child component which renders the input, Here I have extract those logics to a hook which I believe makes the code more clean and readable.

**Conclusion**
This is just a simple example to demonstrate this method. Imagine if I had a whole filter component with few more inputs, checkboxes, dropdown selectors then this method would really make sense.

Try this out and let me know your thoughts...😋
Javascript sparse array and how to avoid them
Tags: javascript, beginners, programming
Published: 2022-10-23 18:12:48

Sparse arrays are arrays with elements that are not consecutive and don't always start at index 0. In other words, the `length` property of the array does not match the number of elements in the array and it contains empty indexes. This is not a problem in itself, but it can lead to unexpected results. 

### How to create a sparse array

Sparse arrays can be created by initializing an array with the `Array()` constructor or when a value is assigned to an index that is greater than the current length of the array. 
For example, if you have an array with 3 elements and you assign a value to the 4th index, the array will become sparse.

```js
const arr = [1, 2, 3];
arr[4] = 4; // [1, 2, 3, <1 empty item>, 4]
```

Similarly, if you increase the length of the array, the array will become sparse.

```js
const arr = [1, 2, 3];
arr.length = 5; // [1, 2, 3, <2 empty items> ]
```

Another way a sparse array can be created is by using the `delete` operator. This will remove the element from the array, but it will leave an empty index.

```js 
const arr = [1, 2, 3];
delete arr[1]; // [1, <1 empty item>, 3]
```

### Why can sparse arrays be a problem?

The main problem  with sparse arrays is that some JavaScript methods do not handle spare arrays the same way. Meaning, that some methods will ignore the empty indexes and some will not. 
For example, the `Array.prototype.filter()` method will ignore the empty indexes but the `Array.prototype.map()`  method will not.

```js
const arr = [1, 2, 3];
arr[4] = 4;
arr.map(v =>  v); // [ 1, 2, 3, <1 empty item>, 4 ]
arr.filter(() => true) // [ 1, 2, 3, 4 ]
```
Note that the `Array.prototype.filter()` method can be used to remove empty indexes from an array.

Another reason to watch out for sparse arrays is that some array methods will convert holes to `undefined` and some will not. 
For example, the spread operation (`...`) will convert holes to `undefined` while `Array.prototype.slice()` will not.

```js 
const arr = [1, 2, 3];
arr[4] = 4;
const res = [...arr]; // [1, 2, 3, undefined, 4]
const res1 = arr.slice(); // [1, 2, 3, <1 empty item>, 4]
```

### How to detect a sparse array

Sparse arrays can be detected by checking if the length property of the array is greater than the number of elements in the array or by using the `Object.prototype.hasOwnProperty()` method.

```js
const arr = [1, 2, 3];
arr[4] = 4;
arr.length > arr.filter(() => true).length; // true
arr.hasOwnProperty(3); // false
```
Developer life and mental health
Tags: podcast, mentalhealth
Published: 2022-10-23 18:09:06

Thank you, everyone, for being part of the Podcast and helping it reach the 100th episode. I am so glad we get to share this.

{% spotify spotify:episode:7Ls1Pezx0RJpSZm6Q58xh0 %}

In this episode, I sit down with someone I respect and admire, Jay Wilson. We talk about developer life and how we need to stay balanced and open with those around us to maintain a healthy relationship with ourselves and others.

## Topics include

- Never put work before health and personal life
- Always find someone to talk to if you feel like things are overwhelming you and making you stressed/unhappy
- A good manager will
- Keep your work balanced
- Unblock you
- Protect your time
- Fight for you
- Always having fun with what you’re doing. Life is too short not to
- Jay has a new job starting soon - iOS full time

## Guest Links

Twitter: [@heyjaywilson](https://twitter.com/heyjaywilson)
Twitch: [@mwilson_codes](https://twitch.com/mwilson_codes)
Instagram: [@mwilson_codes](https://instagram.com/mwilson_codes)
Website: [cctplus.dev](cctplus.dev)
YouTube [video of interviewing](youtu.be/uNv2YtcI9Yw)
Should You Focus on JavaScript or WordPress?
Tags: javascript, webdev, beginners, wordpress
Published: 2022-10-23 18:09:02

It depends on your preference...

I have been focusing on JavaScript for the past 2 years, and I'm totally satisfied with my decision to switch from PHP/WordPress to JavaScript/React.Js/Next.Js.

**Don't get me wrong!**

I really love PHP and WordPress... I built many awesome projects with these technologies. Still, before I switched, I was constantly worrying about PHP losing ground as a preferred backend choice.
This programming language is strongly specialized for server-side scripting.

And it constantly gets improved...

The thing is, many other languages like (Node.js/Python/Golang) have entered the competition in that area and are stealing market share. If you check PHP in Google Trends, you will notice it's losing popularity.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eziokrgw1nb8tf070q0o.jpg)

On the other hand, some people say WordPress powers nearly 40% of all websites. So there are many opportunities here: from making and optimizing websites to distributing themes and plugins.

You will never be hungry if you become a decent WordPress developer.

Moreover, as more and more people hop on the JavaScript and Python "bandwagons," there will be increased demand for PHP developers, and the salaries will start growing.

But bear in mind that not many cool projects use those technologies. You will handle a lot of legacy code, and the "wp style" of coding is uber quirky. It still needs to catch up with the PHP Standard Recommendations (PSR), any proper OOP concepts, etc.

So if you want to write modern, clean code for a rising startup... using a programming language on the crest of the wave...

Then WordPress shouldn't be your primary focus.

You should focus on JavaScript…
Como instalar Brew en Linux (Ubuntu/ZorinOs)
Tags: linux, programming
Published: 2022-10-23 17:49:23

Procederemos a abrir la terminal para poder empezar
1. Colocamos el codigo que se encuentra en su pagina oficial (https://brew.sh/).

`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`

si no te deja seguir con la instalación verifica que tengas "Curl", "Git". Entonces puedes copear los siguientes codigos
`sudu apt install curl`
`sudu apt install git` o puedes ir a su página oficial de Git (https://git-scm.com/download/linux) y seguir los pasos para obtener la versión mas reciente :)

Una vez dicho esto, podemos seguir...

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qww2tmozv479ibrbl84n.png)

Cuando finalize, nos aparecera algúnos pasos a seguir, que son los siguientes

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bn0ot6gy30cjyol0v1sb.png)

Copeando:
1. `echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /home/hector/.zprofile`
2. `echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/hector/.zprofile`
3. `eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"`
4. `sudo apt-get install build-essential`
5. `brew install gcc`

Aquí un ejemplo de como puedes usar Brew
`brew install neovim`
EBS key important Features that every DevOps Developer Need to know
Tags: aws, ebs, ebsnapshot
Published: 2022-10-23 17:38:03

---
title: EBS key important Features that every DevOps Developer Need to know  
published: true
description: 
tags: AWS, EBS, EBSnapshot, 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-10-23 16:59 +0000
---
**EBS Snapshot Archive**
- EBS Snapshot Archive is somthing, you have not taken data very frequently manner
ex. you will taken data on monthly or yearly
- it will goes on the 24 to 72 hours for restoring the Archive (Clear fancy word of Archive : Archive is something either Data/Files that you can Access them Again in the Future)
- Mover a Snapshot to an "Archive tier" that is 75% cheaper
- In EBS Snapshot it lower you're storage Cost as compare to EBS tier.
- In EBS you have to pay money as you get the data from it

**Recyle Bin for EBS Snapshot**
- Setup Rules to retain deleted snapshots so you can recover them after an Accidental deletion
- where retention is 1 day to 1 year

**Fast Snapshot Restore(FSR)**
- Basically this Functionality used as Diaster, lets' you have to created the snapshot AZ Region.In unfortuanitely any natural/human made diaster occur so in that situation, you will easily recover that snapshot within few minutes
- when you're snapshot is so-much Big and you want to intialized fully w/o latency so this is so much helpful but you'have to spend much **$$$** for that.

Thanks for Reading the Content!!
Migration of Monolithic to Highly Available and Secure Architecture with AWS 🚀
Tags: aws, architecture, webdev
Published: 2022-10-23 17:33:59

Here is a story of converting an existing web application which is very good at single point of failure as everything that belongs to the application is stacked together (tightly coupled) and deployed inside one single instance.

If any one component fail inside the instance, the entire application goes down and need a physical resource (developer) to fix it and make it up and running.

#### The web application consists of:

- Web Server (React JS Application)
- App Server (Node JS Application)
- Database (MySQL)

The goal here is to create a highly scalable and secure three tier web application using AWS services.

---

![Architecture Diagram](https://miro.medium.com/max/4800/1*Z3Wpol2ecV_v30MZdYwz4A.png)

The modified architecture is more scalable, secure and fault tolerant and could even support disaster recovery with very little modification.

### The Web and AppServer
The basic (react and express) applications are pre-configured with all necessary software installation with the source code and created the Amazon Machine Images.

Launch Templates are then created with the AMI, and AutoScaling Groups are created to scale in and out based on usage. Web Server group is then placed in front of an (Internet Facing) Application Load Balancer to split up the load equally to all instances available with necessary health checks. The App Server group is placed in front of an (Private) Application Load Balancer where it can be accessed only through the other Load Balancer configured via security groups.

The web servers are placed in a public subnets in three Availability Zones and the app servers are placed in private subnets. In order to do any configuration to code or any other settings to app servers, a Bastion Host (Jump-box) is been used through the public subnet.

### The Database
Amazon RDS (MySQL) is created with two read replicas in each AZ, and an Elastic Cache is used to reduce performance issue. Here we could also have a stand-by database in another region in order to be safe due to any disaster.

### Web App Contents
All images, videos and other files, are uploaded to Amazon S3 through VPC Endpoint through the app or web server (to avoid network cost), and then CloudFront Distribution is used to deliver all the files to public through edge locations without any disturbance.

### Authentication and Authorization
Amazon Cognito is used to validate a user and allowed to access to the application. App servers are then using SDK to validate any scopes related to the business logic.