teleren/devto huggingface dataset:
Automation of helm | step 5

Tags: kubernetes, cicd, circleci, helm
Published: 2020-09-28 06:09:27

To automate helm deployment we a need circleCI [configuration](https://github.com/coktopus-org/devOps/tree/project-for-video-dev/.circleci).

#### **BRANCH FILTER**

workflow provides an option to filter the branches on which the circleCI pipeline runs: 

**DEV**

```
workflows:
  main:
    jobs:
      - deploy:
          filters:
            branches:
              only: 
                [project-for-video-dev]
```

**PROD**

```
workflows:
  main:
    jobs:
      - deploy:
          filters:
            branches:
              only: 
                [project-for-video-prod]
```



#### **ORBS**

- [gcp-gke](https://circleci.com/orbs/registry/orb/circleci/gcp-gke) is use to interact with kubernetes engine running in gcloud. It have commands like create-cluster, delete-cluster, and so on . we use rollout-image which updates the deployment with latest image.

- [gcp-gcr](https://circleci.com/orbs/registry/orb/circleci/gcp-gcr) has  built in commands and [gcr-auth](https://circleci.com/orbs/registry/orb/circleci/gcp-gcr#commands-gcr-auth) is use to authenticate the user and it will take the credentials from environment variables of circleCI.



All the images stored in Google Container Registry is a perfectly working image and ready to deploy on environment . so replace the current tag running tag with the newer one in config.yml and push it to repository and merge it to the branch which triggers the circleCI pipeline and circleCI is already setup to run rollout-image command.



#### **EXAMPLE**

dev branch contains [config.yml](https://github.com/coktopus-org/devOps/blob/project-for-video-dev/.circleci/config.yml) file and all the values required to update dev. If any tag will merged to dev branch it will trigger the pipeline and update the dev-deployment with the newly merged tag of image and same in the case of other branches like prod.



#### **KUBERNETES PROCESS**

Once the pipeline is triggered, the kubernetes run their blue-green deployment process and update the image with zero down time.



{% youtube j_zaUhNkqGA%}
Assignment Providers from team ABC
Published: 2020-09-28 06:09:23

The developing need and request among understudies to accomplish excellent grades in their assignment and the need to finish different inside restricted time offers ascend to 'settle my bookkeeping paper on the web' requests. The arrangements got are from the best in class and is bar none. The blend of elements like high caliber, sensible cost and the capacity to meet time limitations make these administrations the best and reasonable alternative for the understudies. This is the reason our customers put their confidence in our specialists for tackling their bookkeeping issues on the web. more - <a href=https://www.abcassignmenthelp.com/assignment-provider> assignment provider</a>
404 Error Page and Redirect with Nuxt
Tags: javascript, vue, nuxt
Published: 2020-09-28 05:58:28

404 Error pages are very easy with Nuxt, but it took me long enough to find a how-to guide that I decided to write my own.

## Custom 404 Error Page

The default Nuxt error page, that you probably have seen already, looks like this.

![Nuxt default error page](https://dev-to-uploads.s3.amazonaws.com/i/cv30vlyhqaz26o41dojg.jpg)

To write your custom error page simply create the file `layouts/error.vue`. Here is an example:

```html
<template>
  <section>
    <h1>404 Page not Found</h1>
  </section>
</template>
```

Use the documentation of [error pages](https://nuxtjs.org/guide/views#error-page) and the source code of the [default error page](https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-app/template/components/nuxt-error.vue) as reference.

## 404 Redirect

The above works nicely for routes that don't exist, but sometimes we want to redirect to the 404 page from another page programmatically.

In this example from my personal site Vue checks if the `404-error-page-and-redirect-with-nuxt.md` file exists to display the article. If no markdown file is found the user is redirected to the 404 page.

To achieve this I import the `error` function in my `asyncData` hook. If the server cannot find the file it forwards to the 404 page with `error({ statusCode: 404 })`.

```js
export default {
  \\ ...
  async asyncData ({ params, error }) {
    try {
      return await require(`~/writing/${params.slug}.md`)
    } catch (e) {
      error({ statusCode: 404, message: 'Article not found' })
    }
  },
  \\ ...
}
```

Use the documentation for [Handling Errors](https://nuxtjs.org/guide/async-data#handling-errors) in `asyncData` as reference.
Web Applications That Scratch My Itch
Tags: react, node, sideprojects
Published: 2020-09-28 05:18:50

The consensus between the web development world is that great web application ideas come from solving your own problems. I don't disagree with that statement, one of my favorite web [app](https://github.com/garageScript/myProxy) that I worked on solve a very irritating problem of mine.

I want to make a post dedicated to all the applications I built either to learn a new framework or just something I build because a certain subject is on my mind. This is my way of trying to procrastinate while being somewhat productive. 

## Self Hosted Markdown Note Application

This is a markdown notes application that stores notes locally on your server and backups using git. My friend initially made another version of it [here](https://github.com/songz/noteapp). I changed the UI and allow the user to change the title of the notes. My version is hosted [here](https://notes.freedomains.dev/)

## Hotel Del Luna Inspired Application

After watching a Korean drama called Hotel Del Luna, I had serious withdrawls just missing the world of the drama. The main actress of the drama made an Instagram account just for her character. I made a simple web application that gives a slideshow of all the pictures on her instgram account. Hosted [here](https://dreamy-mirzakhani-4ce890.netlify.app/)

## Pomodoro Timer

As I have been watching different streamers on Twitch, I realize some streamers set their notification settings to play a portion of a music video for a certain donation amount or subscriptions. I wanted to replicate the settings that's available for a pomodoro timer in which the video plays for 15 seconds. You can find the repo of the MVP [here](https://github.com/hwong0305/yt-pomo) It is also hosted [here](https://immense-bayou-93211.herokuapp.com/)

## Uses

I've enjoy looking at other people's workspace setups to get inspiration to how to make my current WFH environment more productive. I had the idea of taking Wes Bos [uses.tech](https://uses.tech/) and make a version of it that uses the API from [usesthis](https://usesthis.com/). Here is a [demo](https://nameless-dawn-18438.herokuapp.com/) with the [repo](https://github.com/hwong0305/herman-uses).

PS: I am working on deploying the live version of application mentioned in this post. This post will be updated as they go online. (I don't want to lose my post here)
How to get the anchors in an URL from server-side or node / express context
Tags: node, expres, help
Published: 2020-09-28 05:13:09

{% stackoverflow 64096183 %}
This question was originally asked at stackoverflow.com :
I'm building a Trello bot, for which I need to get the authorization token, the official documentation has listed to frame an auth URL like this:  
`https://trello.com/1/authorize?expiration=1day&name=MyPersonalToken&scope=read&response_type=token&return_url=${MY_RETURN_URL}&key=${API_KEY}` 
&nbsp;&nbsp;&nbsp; when the user clicks allow, the auth token will be sent as the `GET` method to the `return_url` given in the auth link above. 
&nbsp;&nbsp;&nbsp; so as expected, I'm getting the correct token but it's not in the form of query or param, the URL looks like `https://return.url.com#32characterslongstring` so how can I parse that token, 
I'm using express server, so I tried to get the full URL with `req.url`, `req.originalUrl` or tried logging the `request` object but I'm unable to get that anchored part

&nbsp;&nbsp;&nbsp;&nbsp; I tried testing locally on my machine but still unable to get the token

&nbsp;&nbsp;&nbsp;&nbsp;my only concern is to get the token or full URL
let's say, I'm having a URL like `https://localhost/param#thisiswhatiwanttoget`
so how can I access that part after # on the server-side? or in nodejs / express context.
Lets bag the T-shirt of Hacktoberfest together 😃
Tags: hacktoberfest, github, git, developer
Published: 2020-09-28 05:09:51

![Screenshot from 2020-09-28 10-02-26](https://dev-to-uploads.s3.amazonaws.com/i/x74bt98jrg0189iuv452.png)
 
# Introduction
Let me speak a few words about hacktoberfest if you are not aware of!!

Hacktoberfest is open to everyone in our global community. Whether you’re a developer, student learning to code, event host, or company of any size, you can help drive growth of open source and make positive contributions to an ever-growing community. All backgrounds and skill levels are encouraged to complete the challenge.

- Hacktoberfest is a celebration open to everyone in our global community.
- Pull requests can be made in any GitHub-hosted repositories/projects.
- You can sign up anytime between October 1 and October 31.


## What you will get??  🤔 
You can either choose a T-shirt or plant a tree

## what you want to do?? 🤔 
You want to just [register](https://hacktoberfest.digitalocean.com/) to the event and try to create 5 Pull Request. This is all enough

### Prerequisites
- git
- github account


If you have this you are ready to start. If you don't have this just go and download [git](https://git-scm.com/downloads) and create a [github](https://github.com) account

## How to register
Inorder to register go to [website](https://hacktoberfest.digitalocean.com/) and click **start hacking**

## I am new to programming, I don't know to write even **Hello world** in any programming language

If you belong to this, Nothing to worry at all!!
Because the projects hosted in github is not only programming. There are lot of books, designs etc. Choose anything you think you can contribute(no need to be an expert in that topic)

### Wait wait I don't know anything about git
Here are some resources to learn about git and github
- [github guides](https://guides.github.com/)
- [how-to-create-pr](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)



## I know coding, what should i do?? 🤔 
If you know to code, You can search in github for hacktoberfest, in the filter you can select issues. This will give you a lot of projects you can contribute to.

![flipkart-scrap](https://dev-to-uploads.s3.amazonaws.com/i/4ugu33xm0dcgn9zjpikg.png)
 
To get started you can give a PR to this [repository](https://github.com/rawho/flipkart-scraper) which is owned by me. I will surely accept your pull request if there is no errors. This will help you to complete your 1/5 of the PR's to be done.

The repo is here [flipkart-scraper](https://github.com/rawho/flipkart-scraper), you can read the future plans section in readme and do accordingly.
Don't worry if you don't know much coding in python. **You can just make the banner look better**. If i like the banner i will merge it

In the comment section you can help others by providing your github repo
Lets help each other😃 😃
Builder Pattern
Tags: creational, dessignpatterns, java, pattern
Published: 2020-09-28 05:04:14

Separate the construction of a complex object from its representation so that the same construction process can create different representations.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n7rhbfnb56v2umu95ck5.png)

#Participants#
* Builder: specifies an abstract interface for creating parts of a Product object
* ConcreteBuilder: constructs and assembles parts of the product by implementing the Builder interface. Defines and keeps track of the representation it creates. Provides an interface for retrieving the product.
* Director: constructs an object using the Builder interface
* Product: represents the complex object under construction. ConcreteBuilder builds the product's internal representation and defines the process by which it's assembled. Includes classes that define the constituent parts, including interfaces for assembling the parts into the final result.

#Code#
```java
public class Main {

	public static void main(String[] args) {
		Director director = new Director();

		Builder b1 = new ConcreteBuilder1();
		Builder b2 = new ConcreteBuilder2();

		director.construct(b1);
		Product p1 = b1.getResult();
		p1.show();

		director.construct(b2);
		Product p2 = b2.getResult();
		p2.show();
	}
}

public class Director {

	public void construct(Builder builder) {
		builder.buildPartA();
		builder.buildPartB();
	}
}

public interface Builder {

	Product getResult();

	void buildPartA();

	void buildPartB();
}

public class ConcreteBuilder1 implements Builder {

	private Product product = new Product();

	@Override
	public Product getResult() {
		return product;
	}

	@Override
	public void buildPartA() {
		product.add("PartA");
	}

	@Override
	public void buildPartB() {
		product.add("PartB");
	}
}

public class ConcreteBuilder2 implements Builder {

	private Product product = new Product();

	@Override
	public Product getResult() {
		return product;
	}

	@Override
	public void buildPartA() {
		product.add("PartX");
	}

	@Override
	public void buildPartB() {
		product.add("PartY");
	}
}

public class Product {

	private List<String> parts = new ArrayList<>();
	
	public void show() {
		System.out.println("\nProduct Parts -------");
		for (String part : parts) {
			System.out.println(part);
		}
	}

	public void add(String part) {
		parts.add(part);
	}
}
```

#Output#
```
Product Parts -------
PartA
PartB

Product Parts -------
PartX
PartY

```
{% github https://github.com/eidherjulian61/design-patterns no-readme %}
{% link https://dev.to/eidher/principales-patrones-de-diseno-13ao
 %}
jq hack #1: colored less
Tags: jq, json
Published: 2020-09-28 04:59:12

Sometimes you want to look at a lot of JSON output in the terminal. Sometimes this JSON output is nicely formatted, and often it is compacted by a REST endpoint. Examples of verbose output:

```
$ kubectl get nodes -o json
$ curl 'https://hacker-news.firebaseio.com/v0/topstories.json'
```

In both cases you can pipe the output through:

```
$ ... | jq -C . | less -R
```

The `-C` parameter to `jq` forces colors. When omitted, `jq` will only print colors when an interactive terminal is detected. Piping further into `less` removes the colors. Additionally, we have to tell `less` to interpolate those ANSI colors so that we don't see a bunch of `ESC[1;39m` codes.

```json
$ kubectl get nodes -o json | jq -C . | less -R
{
  "apiVersion": "v1",
  "items": [
    {
      "apiVersion": "v1",
      "kind": "Node",
      "metadata": {
        "annotations": {
...
:
```

Here,
  - `jq -C`:
    ```
    --color-output / -C and --monochrome-output / -M:

    By default, jq outputs colored JSON if writing to a terminal.
    You can force it to produce color even if writing to a pipe
    or a file using -C, and disable color with -M.
    ```
  - `less -R`:
    ```
    -R or --RAW-CONTROL-CHARS
    
    Like -r, but only ANSI "color" escape sequences are output in
    "raw" form. Unlike -r, the screen appearance is maintained
    correctly in most cases. ANSI "color" escape sequences are
    sequences of the form:

        ESC [ ... m

    where the "..." is zero or more color specification characters.
    For the purpose of keeping track of screen appearance, ANSI color
    escape sequences are assumed to not move the cursor. [...]
    ```
How to use the built-in Date Object to Get the Current Date in JavaScript?
Tags: javascript, webdev, beginners
Published: 2020-09-28 04:53:02

When you are building a website, you will come across various types of date components-- it could be to create a date of a resource or the timestamp of an activity.

Handling these date and timestamp formatting can be a daunting process. Read on to understand how you can get the current date in different formats in JavaScript.

<h2>JavaScript's Date Object

The built-in Data object stores the date & time while providing methods for handling them.

You have to use the new keyword to build a new instance of the Date object:

<I>const date = new Date();

There are methods for getting the current year and current day of the month, have a look at it:

For year:

<I>const currentYear = date.getFullYear();
<I>console.log(currentYear);

For day of the month:

<I>const today = date.getDate();
<I>const currentMonth = date.getMonth() + 1; 

<h2>Date Now

now() is a static method of the Date object. This is how it is used:

<I>const timeElapsed = Date.now();
<I>const today = new Date(timeElapsed);

<h2>Formatting The Date

To format the date into several different formats like ISO, GMT, you can make use of the methods if the Date object.

The toDateString() method returns the date in a human readable format:

<I>today.toDateString();

The toISOString() method returns the date which follows the ISO 8601 Extended Format:

<I>today.toISOString(); 

The toUTCString() method returns the date in UTC timezone format:

<I>today.toUTCString(); 

and so on.

<h2>Custom Date Formatter Function

Your date could be in yy/dd/mm or yyyy-dd-mm format. To get rid of the uncertainty, it might be beneficial for you to build a reusable function so that it can be used across multiple projects.

<I>const today = new Date();

<I>function formatDate(date, format) {
	//
<I>}

<I>formatDate(today, 'mm/dd/yy');

You need to replace the strings "mm", "dd", "yy" with the desired month, day and year values from the format string passed in the argument.

To do that you can use the replace() method like shown below:

<I>format.replace('mm', date.getMonth() + 1);
Is jquery dead?
Tags: watercooler, discuss, javascript, html
Published: 2020-09-28 04:46:29

With the release of bootstrap 5, a lot of guys were excited that it no longer depends on jquery. However, I've always found jquery fun to work with,  especially for projects that don't require an elaborate frontend framework. So, what are your thoughts on jquery? Should it be wiped out from the face of the earth(the world wide web rather😀)?
I'm interested in hearing your thoughts.
OSD600 - Lab 1 - Link-checker
Published: 2020-09-28 04:41:38

Finding someone to check someone's code or have yours checked can be done on "Slack".  After I did a version 2 of my Release 0.1 someone asked me if I could check their code.  I found it interesting that they separated each element into separate tasks.  For example, setting up the arguments to fetch, then fetching multiple files and then run by a main.  I liked that part however this project seemed to me like it was larger then it needed to be. What I mean is, there is a link-check.js and an index.js Am I wrong?  I thought professors taught us that using less data to perform a task is better.  But then I have never worked in the field to even have a validated opinion.  

Unfortunately the first command's output was: 

Usage lct <command> [options]
Options:
  -f, --file     Load file(s)                                         [required]
  -v, --version  Show version number                                   [boolean]
  -u, --url      Check a specific url
  -h, --help     Show help                                             [boolean]

Examples:
  lct -f foo.js                    Check all valid URLs in the file
  lct -fu https://www.google.com/  Check the status of https://www.google.com/

I thought there was missing instructions in the README but it turns out that only the single command works.  The multi-file command does not work either with an error of no such file or directory open.  Which would lead me to conclude that the "fetch" is not working.

Issues:  https://github.com/phast184/link-checker-tool/issues/7#issue-709913935

My Issues: https://github.com/strawberries73/OSD600-Journey-on-rocky-trails/issues/1

It was suggested that I refractor my conditions to just print the results if I am not adding colour to my results.  If I was just looking to print everything in the same colour I would just removed the extra if/if else and just proceed to console.log.  Since my feature is adding colour, then I will not change my code.
Best Screen Recorders for Developers
Tags: webdev, productivity
Published: 2020-09-28 04:07:42

Personally, I need tools that are:

- recording the screen with high video quality
- recording both internal and microphone sound
- supporting webcam and PIP modes
- watermark-free
- capable of recording long videos, like an hour
- built with editing features
- ad-free if recording online

After testing 10+ screen recording tools, I found the top 3 for my work (software demo, employee training, working with the support team in our company, etc. ) 

<a href="https://github.com/obsproject/obs-studio">OBS</a> 

a) Free and open-source
b) Available on Windows, Mac, and Linux
c) Support more formats, FLV, MP4, MOV, MKV, TS, and M3U8. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pbbhq91dkokzmn8nts3h.jpg)

<a href="https://www.bandicam.com/">Bandicam</a> 

a) The max quality in 4K@480FPS
b) Record external video devices such as a webcam, Xbox/PlayStation, smartphone, IPTV, etc.
c) Offload CPU when it is performing multiple tasks.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qi5iwyvnp2nekx9htcrj.jpg)

<a href="https://www.techsmith.com/video-editor.html">Camtasia</a> 

a) Multiple annotation tools: callout, titles, zoom, pan, animate
b) Non-linear video editing features
c) add a voiceover in post-editing

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/81okvt2namzjybk1g6nj.jpg)

Most recommendations from: https://www.videoproc.com/download-record-video/best-screen-recorder.htm
Normalization of data in SQL
Published: 2020-09-28 04:03:02

In this blog I will be going over what normalized data is and how I was able to implement it into my SQL database. 

First, I will explain what normalized data is. There are multiple different levels to data normalization, but I will only be discussing the first two levels. The first level has three requirements it must meet to be considered first normal form. One requirement is that the data can be identified by a primary key and is in rows and columns. The second requirement is that the data is in its most reduced form. The final requirement is that there cannot be any repeats  or redundancy within the data. 

One example from my Covid-19 database that does not pass these requirements is within my behavior table. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/l5sexcmwubm5t9nw00mw.png)

In this table I have a column for attends group functions, and another column for social distances. Since you can assume that if somebody doesn't social distance then they also attend group functions this makes them redundant. To fix this I will get rid of the attends group functions column.

Next, we have the second normal form. This normal form has all of the same requirements from the first normal form, but the data must also relate directly to the primary key. 

In my database I have a column named Patient in each of the different fields. The patient number does not directly relate to all of the fields such as hospital.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/w1xt2o9r60ifmjcj7rbx.png)

I can fix this by getting rid of the patient column in all of the fields except for the patient field.

I created the video below further explaining what normalized data is and how to adjust your database accordingly within SQL.

(Sorry it is in two video's I accidentally stopped recording during the first video and could not edit them together.)

{% youtube osTrZ4QOsfY %} 

{% youtube MCda8q4FIC0 %}