teleren/devto huggingface dataset:
What is 'this' ? 😳
Tags: javascript, codenewbie
Published: 2021-08-31 07:09:16

##This 😭

The this keyword can lead to some headaches in JavaScript - this blog hopefully acts as a remedy.

![hi](https://media.giphy.com/media/h36vh423PiV9K/giphy.gif?cid=ecf05e4737goqavfe8abhgzhc5pbdgd86g3hx0to7j6kgboj&rid=giphy.gif&ct=g)

this refers to different things, depending on where it's used and how (if used in a function) a function is called !

Generally, this refers to the "thing" which called a function. That can be the global context, an object or some bound data/ object (e.g. when the browser binds this to the button that triggered a click event).

##1) this in Global Context (i.e. outside of any function)

```javascript
function something() { ... }
 
console.log(this); 
```

// logs global object (window in browser) - ALWAYS (also in strict mode)! 🙌


##2) this in a Function (non-Arrow) - Called in the global context

```javascript
function something() { 
    console.log(this);
}
 
something(); 
```

// logs global object (window in browser) in non-strict mode, undefined in strict mode 🙌


##3) this in an Arrow-Function - Called in the global context

```javascript
const something = () => { 
    console.log(this);
}
 
something(); 
```

// logs global object (window in browser) - ALWAYS (also in strict mode)! 🙌

##4) this in a Method (non-Arrow) - Called on an object

```javascript
const person = { 
    name: 'Mayank',
    greet: function() { // or use method shorthand: greet() { ... }
        console.log(this.name);
    }
};
 
person.greet(); 
```
// logs 'Max', "this" refers to the person object 🙌

##5) this in a Method (Arrow Function) - Called on an object

``` javascript
const person = { 
    name: 'Max',
    greet: () => {
        console.log(this.name);
    }
};
 
person.greet();
```
 // logs nothing (or some global name on window object), "this" refers to global (window) object, even in strict mode 🙌

*If in doubt, a console.log(this); can always help you find out what this is referring to at the moment!*

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/og3yo6blha2karbyqj7e.png)

**HAPPY CODING 👨‍💻**
TIL how to get a plaintext list of Ansible hosts
Tags: todayilearned, ansible, jq
Published: 2023-05-19 20:38:46

---
title: TIL how to get a plaintext list of Ansible hosts
published: true
date: 2021-08-31 07:04:00 UTC
tags: TIL,ansible,jq
canonical_url: https://www.zufallsheld.de/2021/08/31/til-how-to-get-a-plaintext-list-of-ansible-hosts/
---

There was a need to iterate over the hosts in an Ansible inventory-file (don’t ask). After fiddling around with grep and sed, I found an easier method:

```
ansible-inventory --list all | jq " ._meta.hostvars| keys[]"

```

`ansible-inventory --list all` lists all hosts including their variables in a nice big json response.

`jq " ._meta.hostvars"` then filtersonly for these variables:

```
{
  "host01": {
    "list_variable": [
      "195.13.41.220",
      "195.13.41.221",
      ]
    }
}

```

Now I only need the `host01`-part, the keys of this dictionary. jq’s `keys[]` function does this.

```
> ansible-inventory --list all | jq " ._meta.hostvars| keys[]"
"host01"
"host02"
"host03"
"host04"
"host05"
"host06"

```
Sandwich Bread Supplier in Ernakulam
Tags: sandwichbreads, bakersinernakulam, healthybreads
Published: 2021-08-31 06:53:20

Rising Loaf, one of Ernakulam's greatest bakeries, creates handcrafted premium made-to-order baked delicacies free of preservatives and additives. Custom cakes, superb gourmet sweets, and delicacies are available. Our blends are one-of-a-kind because they combine a lot of skill and expertise with natural baking ingredients to give you the best sweetness and taste experience possible.
Sandwich Bread Supplier in Ernakulam are committed to making the
highest-quality breads with no artificial preservatives, colors,or flavors. We take pride in providing an exceptional experience to all of our clients, big and small. To keep the authentic taste and fresh flavours in our confectioneries, we are fascinated with using only high-quality and fresh ingredients in our products. All of our loaves of bread, cakes, cookies, donuts and muffins, and cupcakes are prepared with great care and affection in Ernakulam's most sanitary atmosphere.
At Rising Loaf, we define success as the fullness of our clients' grins as they sample our delectable products and return for more. They are the icing on our cake, the fuel that drives us to improve our baking and service. Thank you for all of your kindness and encouragement!
Rising Loaf, the top Bakers in Ernakulam, was founded by friends with a passion for baking, with the goal of producing handcrafted premium baked goods that are absolutely free of dangerous food preservatives and additives, and delivering them to your home. Whatever the occasion, Rising Loaf is here to make you happy.
AWS Lambda
Tags: aws, cloud, devops
Published: 2021-08-31 06:41:38

AWS Lambda is function as service in AWS it means that we define what we want to run on AWS as a function and AWS runs it it does not matter how much RAM, storage it requires. It does not require you to provision any servers. It also runs on demand and you pay for compute time and no of times you run required function. It can scale infinitely. Scaling and pay on compute time makes it a service of choice for many developers.

## Benefits

1. You don't need to manage any servers for your back end service.

1. It lets you run I million requests and 400 thousand of compute time in free tier so that you can get well versed with it before using it.

1. Easy pricing you have to pay for compute time and number for request

1. Language support Node.js, Python, Golang C# etc and all other using many API provided custom API

1. Very easy to add resources.

1. Only used as for resources when needed

Next we will do a hands on AWS Lambda
ways to increase appetite
Tags: ways, to, increase, appetite
Published: 2021-08-31 06:12:25

Loss of taste: Extreme aversion to food, not wanting to take anything in the mouth. Such days come many times. There could be many reasons for this. Such as Liver problems, jaundice, loss of taste. Stomach or intestinal problems, acidity, infections or cancer cause awkward anorexia. Kidney patients have the same problem. 
<a href="https://kitcheninstument.co/loss-of-taste-21-natural-ways-to-increase-appetite/">Loss of taste: 21 natural ways to increase appetite, cravings</a>
GitHub Copilot on Codespaces on an iPad + GitHub Codespaces Q&A
Tags: github, codespaces, ipad, codenewbie
Published: 2021-08-31 06:28:22

Do you know you can __develop any application on your iPad__? Well, thanks to Codespaces you can!

In this live streaming I'm going to have a quick demo of using GitHub __Codespaces on iPad__, and we will also see __GitHub Copilot in action within Codespaces__.

I will also answer all your __questions about GitHub Codespaces__. So prepare your questions! And if you can't make it, __post your questions or comments down below__ so I can address them during the live!

{% youtube ELBJjwpUn1s %}

[Link to the video: https://youtu.be/ELBJjwpUn1s](https://youtu.be/ELBJjwpUn1s)

See you there!

__Like, share and follow me__ 🚀 for more content:

📽 [YouTube](https://www.youtube.com/CoderDave)
☕ [Buy me a coffee](https://buymeacoffee.com/CoderDave)
💖 [Patreon](https://patreon.com/CoderDave)
🌐 [CoderDave.io Website](https://coderdave.io)
👕 [Merch](https://geni.us/cdmerch)
👦🏻 [Facebook page](https://www.facebook.com/CoderDaveYT)
🐱‍💻 [GitHub](https://github.com/n3wt0n)
👲🏻 [Twitter](https://www.twitter.com/davide.benvegnu)
👴🏻 [LinkedIn](https://www.linkedin.com/in/davidebenvegnu/)
🔉 [Podcast](https://geni.us/cdpodcast)

<a href="https://www.buymeacoffee.com/CoderDave" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 30px !important; width: 108px !important;" ></a>
React/Redux Todo App
Tags: redux, javascript, rails, portfolio
Published: 2021-08-31 06:27:17

In this portfolio I designed a todo app to help anyone map what they want to do in a day, week, month, year. It was challenging at first finding idea when the assignment let you with free choice. I started by create a react app using npx create-react-app todo, the get into it with this command CD todo, lastly start the server with npm start.

    The goal of this app is to let you create a wave of task you would like to keep track of and mark done when completed. When the user goes to the front page you either sign in or sign up, a user needs a username and password. The password is case sensitive not the username, I used bcrypt in the rails backend to ensure the users are secured.
Once login or sign in, a user can go straight forward to create or delete a task, each task has a description line where you can explain what you mean in the title.
It's a simple as that, once done you can navigate between profile to see your list of task where you can filter them by "all, completed and incomplete".
This was challenging to get done as I kept breaking what was done before. Lastly you can logout and go on about anything else you were doing.
 
    The most challenging part of this project was to use redux in the app, I enjoyed every single error I ran into because debugging is one of my weakness besides explaining that I'm working on. Thank you to ever single one of you that takes time to read my blog, use my app. Every single feedback or contribution is gladly accepted.
Adding a User Model
Published: 2021-08-09 00:40:57

A big part of the fun of designing an application is making decisions about what to prioritize.

You make those decisions by asking questions like:
- What are the essential features of the project?
- What are the time costs of those features?

At this stage of the project, I'm able to view a blog feed of all users and then by clicking on a list of usernames, convert that feed into a list of posts by the selected user.

The oldest posts currently in the database were created manually for testing purposes - they were hardcoded with the following fields: *author*, *title*, *text*, and *date*.

The most recent addition to the site is a functioning endpoint at `/create`, aka a 'write a post' page, that allows you to input a title and body into textarea fields and POST that data to the API.

The server then reads that data and also collects the user info via the OpenId info attached to the post request by middleware. Now it has everything it needs to create a Mongo document (ie. a record).

The problem is that OpenId is pulling my user info from my google account - an account that has some bio information that a user might not be willing to share publicly. The easy solution might be to use the email address as username for now, but looking at an email address in the user-list just looks awful. Email as username just doesn't seem right.

So I've decided that my next step is going to be implementing a User Model which will provide the following benefits:

- Displaying dynamic usernames instead of email addresses or personal name.

- Normalizing the DB by moving a step toward storing user info in the Blog Post model. This has already been a pain when writing a query to fetch all usernames for the user list.

- I'll be able to build on the user model to implement a sign-up page.
protect your eyes from computer screen
Tags: eye, protection, save, eyes
Published: 2021-08-31 06:09:54

eye protection: Most of the tasks of daily life nowadays have become technology dependent. Especially because of the Corona epidemic, everything from children to adults, everything from education to work is now dependent on online. For this, we have to spend a lot of time during the day looking at the screen of computer or mobile. According to experts, protecting the eyes from computer screens and mobiles is extremely important.
<a href="https://www.suggestfor.com/eye-protection-save-your-eyes-from-computer-and-mobile-screen/">Eye protection: save your eyes from computer and mobile screen</a>
JSON in 10 minutes
Tags: json, javascript, webdev, beginners
Published: 2021-08-31 06:03:26

Explained about
How to create JSON
How to read JSON data
How to Parse JSON
Convert JSON to string
Why to prefer JSON to XML
Difference between Javascript Object and JSON
How to get keys of object 
https://youtu.be/GUQ8vwuBAU0

Timestamps :
00:00 Introduction
00:57 JSON creation
05:37 Using JSON in Javascript
07:17 Reading JSON data
09:22 JSON methods
09:53 JSON.parse
11:09 JSON.stringify
11:42 Object.keys
12:13 JSON vs XML
13:08 stringify in detail

{% youtube GUQ8vwuBAU0 %}
OWASP ZAP: A Dive into Web Security Testing
Tags: softwaretestingcompany
Published: 2021-08-31 06:03:08

Securing websites are indispensable these days. So to make web applications secure, there are many tools which are used for scanning and finding out vulnerabilities of applications. So here you will see an easy way to run web penetration using ZAP (zed attack proxy).

What is OWASP ZAP?
OWASP (Open web application security project) is a vendor neutral, non-profitable organization dedicated to improving the security of web applications. ZAP is open source and one of the most popular security testing tools for web applications which is used to perform penetration testing and It belongs to the OWASP community so it’s totally free. It assists testers to detect any security vulnerabilities in websites.

Advantages of ZAP
Zap (Zed attack proxy ) is a java based tool that enables testers to perform fuzzing , writing scripts for it, spidering and proxying to attack web applications.
Zap is platform independent that means It can be used across all operating systems (Windows, Linux, Mac).
Zap is an open source and free tool to use.
After completion of testing it can generate Reports also.
We can reuse the zap session for avoiding re-coding the whole process again on functional changes.
AWS Container Services
Tags: aws, cloud, devops, cloudskills
Published: 2021-08-31 05:55:30

Docker is used a lot for deploying production services on the servers. To allow this paradigm of deployment AWS has many services like Elastic Container service, Fargate serverless container service, container registry in this series we will learn about the container services in AWS.

## ECS

Amazon Elastic Container Service (Amazon ECS) is a fully managed container orchestration service that helps you easily deploy, manage, and scale containerized applications. It deeply integrates with the rest of the AWS platform to provide a secure and easy-to-use solution for running container workloads in the cloud and now on your infrastructure with Amazon ECS Anywhere.

### Benefits: 

1. Easily manage your deployments using existing tools.

1. Eliminates the need for you to install, operate, and scale your own cluster management infrastructure.

1. Makes best use of your instance resources by using containers

## Fargate

AWS Fargate is a technology that you can use with Amazon ECS to run containers without having to manage servers or clusters of Amazon EC2 instances. With Fargate, you no longer have to provision, configure, or scale clusters of virtual machines to run containers. This removes the need to choose server types, decide when to scale your clusters, or optimize cluster packing.

### Benefits

1. We don't have to worry about the servers.

1. We pay only for the resources we use as its fully serverless

1. We can focus on building applications

## AWS ECR

AWS Elastic Container Registry (Amazon ECR) is a fully managed container registry that makes it easy to store, manage, share, and deploy your container images and artifacts anywhere. Amazon ECR eliminates the need to operate your own container repositories or worry about scaling the underlying infrastructure. Amazon ECR hosts your images in a highly available and high-performance architecture, allowing you to deploy images for your container applications reliably. You can share container software privately within your organization or publicly worldwide for anyone to discover and download.
AWS para todos
Tags: aws, awsparatodos, pynef, noob
Published: 2021-08-31 05:40:56

Hola a todos, este es el primer post de mi blog
Y quiero comenzar presentándome.

Mi nombre es **Nefi Arroyo**.
Me inicié hace ya varios años en el mundo de la tecnología pasando por diferentes roles, iniciando como desarrollador web y actualmente como arquitecto Cloud.

El objetivo de este blog es que toda persona que quiera entender, aprender, curiosear o incluso cambiar de carrera, incorpore conocimientos generales y específicos sobre la nube de Amazon Web Services (AWS) con el contenido que le brindaremos aquí.

 * Aquí escribiremos post cortos para no perder el enfoque de lo que queremos aprender.

 * Nos tomaremos un tiempo para poder explicar palabras o términos que no son comunes para las personas que se estén iniciando en el mundo de la tecnología.

Así que los esperamos para poder crecer juntos
Dynamically change timestamp based on time zone in JavaScript
Tags: javascript, programming, webdev, ui
Published: 2021-08-31 05:39:00

In order to dynamically change timestamp based on time zone in JavaScript you first need to get your system’s IANA time zone in JavaScript using:
```
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone)
```

Once you have your system’s time zone, you need to assign the value of timestamp to a variable. The time stamp can be of any format, the following code is using ISO date format which is commonly used by Azure B2C, etc. In the next step we need to convert the date to a string using **toLocaleString()** method which helps in the sensitive representation of the date. You can now use the string to change the time stamp to your time zone.
```
var timeStamp = new Date("2011-08-12T20:17:46.384Z"); 
//ISO date format
console.log(timeStamp.toLocaleString('en-US', { 
   timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone 
}))
```

**Use case:** If you have a global web application and you want to display time stamp of account creation to the application administrator.

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

Follow us on [Instagram ](https://www.instagram.com/commitandpush/)
Tech Interview: Rate yourself out of 10
Tags: interview, career, fresher, tips
Published: 2021-08-31 05:38:30

![rate yourself out of 10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7aki745ghxmsq8vy1olh.png)

## Logic
Interviewers ask this question to get an idea how good the candidate is or what can be a first few set of questions. In first go, this seems to be a very easy question, like a candidate might translate this roughly into "How much comfortable are you in using XYZ in your projects?". When I see the broader picture, I understand the actual answer that a candidate delivers is "(how much he knows) out of (how much he thinks exists in the world)" which is not wrong, but also not valid.

If a candidate doesn't know the vastness of the concept, he would never be able to justify his answer. A person who knows how vast that particular technology is, should be able to answer honestly, and things can be expected to go smooth for him during interview.

## Experience:
Last year, during one of my interviews I was asked to rate myself in JavaScript. I answered "3/10". The interviewer was shocked. He asked me the reason for such a low rating. I shared my views with him. He accepted my justification, and then he named a few topics and asked my familiarity with those concepts. I answered what I knew and things went well.
The ephemeral miniconf - José Joaquín Atria
Tags: perl, raku
Published: 2021-08-31 05:20:45

# Speaker announcement: José Joaquín Atria
[José Joaquín Atria](https://www.pinguinorodriguez.cl/) is a researcher and programmer based in London.

![Atria](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxs5zleif1cmqrg7fv9c.png)

He was one of the early speakers to join [the ephemeral miniconf](https://thibaultduponchelle.github.io/the-ephemeral-miniconf/) \o/

## Bio
José Joaquín Atria own bio says: 
"A Speech Scientist in a previous life, I now work full time as a programmer, and appreciate the stable hours and not having to fund my own work. If you need a climbing buddy, hit me up!"

Or even "I write code for fun, and some times get paid to do it" :heart:

## Talk
I'm afraid to declare that I have yet no idea what José Joaquín will talk about :grinning:

![Top Secret](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t3unrhdk5rkjpkgbqf4n.jpg)
The ephemeral miniconf - Clement Oudot
Tags: perl, raku
Published: 2021-08-31 05:19:33

# Speaker announcement: Clement Oudot
When I tried to find speakers for [the ephemeral miniconf](https://thibaultduponchelle.github.io/the-ephemeral-miniconf/), I contacted (or "bothered" or "spammed") some french people that I knew could give very interesting talks. And I'm very happy that it worked! 

[Clement Oudot](https://fr.linkedin.com/in/clementoudot) is a strong Open Source (or even "Open standard") believer, and as such he is part of the board of [CNLL](https://cnll.fr/) and [OW2](https://www.ow2.org/).

![Clement Oudot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eidp3uo84blwkt9drdui.jpeg)

He is also an expert in LDAP and more in general directories, IAM, authentication etc... 

## Talk
Clement will present [LemonLDAP::NG](https://lemonldap-ng.org/welcome/) which you probably already know since it's a major implementation of the Lightweight Directory Access Protocol.

![Announcing Clement Oudot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ssqgy2c3lvf4qr9d58b.png)
How to enable CORS on Django REST Framework
Tags: django, djangorestframework, python
Published: 2021-08-31 05:04:07

When we develop rest api and want to consume form different website we have to enable cors.

In this tutorial i will show you how to enable cors

Install package

pip install django-cors-headers
and then add it to your installed apps:

```

INSTALLED_APPS = (
    ...
    'corsheaders',
    ...
)
```
You will also need to add a middleware class to listen in on responses in seetings.py:

```
MIDDLEWARE_CLASSES = (
    ...
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    ...
)
```
Now i will give two alternative anyone you can do

```
ALLOWED_HOSTS=['*']
CORS_ORIGIN_ALLOW_ALL = True
second alternative

ALLOWED_HOSTS=['http://localhost:5000']        
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = (
   'http://localhost:5000',
)
```

Thank you for reading my article! If you enjoyed it and would like to support my work, please consider buying me a coffee at **[Buy Me a Coffee](https://www.buymeacoffee.com/giasuddin)**. You can also learn more about me and my work by visiting my **[Giasuddin Bio ](https://bio.link/giasuddi)**and following me on LinkedIn and Twitter. Thank you for your support!
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 36
Tags: php, javascript, webdev, tutorial
Published: 2021-08-31 05:01:01

Netflix provides streaming movies and TV shows to over 75 million subscribers across
the globe. Customers can watch as many shows/ movies as they want as long as they are
connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces
original content and also pays for the rights to stream feature films and shows.

In this video,we will be adding DataTables plugin

{% youtube F33pGG82dJ4 %}


If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)