teleren/devto huggingface dataset:
Explanation of JavaScript "this" keyword

Tags: javascript
Published: 2021-12-28 20:26:44

this keyword is mostly used in object-oriented programming. Most of the beginners are confused with this keyword. Today I am trying to tell about this keyword easily so that everyone can understand.

Generally, this keyword refers to the object by which it is bounded.
this keyword has different values depending on the place of use.

In a method, this refers to the owner object.
Alone, this refers to the global object.
In a function, this refers to the global object.
In a function, in strict mode, this is undefined.
In an event, this refers to the element that received the event.
In the call() and apply() method this can refer to any object.

**In a method:**

```
const person = {
  firstName: "John",
  lastName : "Doe",
  id   	: 5566,
  fullName : function() {
    return this.firstName + " " + this.lastName;
  }
};
console.log(person.fullName()); //output John Doe

```
In this object fullName is a method. Here this in fullName method refers to owner object that means person object.

**this Alone:**

```
console.log(this); //output window
```
When we use this alone the owner is the global object so this refers to the window object.

```
“use strict”
console.log(this); //output window
```
If we use this alone in strict mode, it also refers to the global window object.


**In a function:**

```
function myFunction() {
  return this;
}
console.log(myFunction()); //output window
```
When we use this in a function this refers to the global window object.

If we use this in a function in strict mode then this is undefined.

```
“use strict”
function myFunction() {
  return this;
}
console.log(myFunction()); //output undefined
```

**In an event:**
If we use this in an event or javascript event handlers this refers to the element which is used to trigger the event. For example

```
<button onclick="this.style.display='none'">
  Click to Remove Me!
</button>
```
 
Here this refers to the button element because here button is the event trigger.

**In call() and apply() method:**
call() and apply() methods both are javascript built-in methods.Both of them are used to call an object method with another object as the argument.

```
const person1 = {
  fullName: function() {
    return this.firstName + " " + this.lastName;
  }
}
const person2 = {
  firstName:"John",
  lastName: "Doe",
}
const person3 = {
  firstName:"Feroj",
  lastName: "Alam",
}
console.log(person1.fullName.call(person2)); //output John Doe
console.log(person1.fullName.apply(person3)); //output Feroj Alam
```
Here person1 object has no first name and last name. We use the call() method to use first name and last name from another object which is person2. We can also use apply() method to use the first and last name from another object that is person3. So that this refers to the person2 object and person3 object.
we're hiring! any advice on reaching people?
Tags: react, java, testing, kotlin
Published: 2021-12-28 20:45:32

we're a small dev team building apps for basketball coaches. We work with NBA, NCAA, Olympic teams, everyone. The apps are so cool and fun to work on. We're hiring for 3 new positions (QA, Frontend-react, Backend-java/kotlin) but am not sure how to reach developer communities that might be interested. Any advice on how to reach these communities?


https://www.linkedin.com/company/fast-model-technologies/jobs/
Topic: Node Emit
Published: 2021-12-28 20:41:16

Node Js has built in event module to handle event. I expect that we all know what the event is. Actually, event create an action when user triggered. Events can be user-generated, such as keystrokes and mouse clicks. But these events are built in. We can't make our event as our choice. In node js, we can make our event. [Node Event](https://nodejs.org/api/events.html#class-eventemitter) by clicking this you can get the official docs. 

## **Node Event**
One of the core concepts of Node.js is events. Event Emitter plays a vital role in Node.js Event-Driven Architecture.

## **How does it work?**
Node Emit works in three ways. 
1. Event Emitter emits the data in an event called message
2. A Listened is registered on the event message
3. when the message event emits some data, the listener will get the data.

## **EventEmitter methods and description**

1. on(): on(event, listener), by this method we can add event listener. It is just like 'addListener' keyword in JavaScript. 
2. emit(): emit(event, arg1, arg2), by this event we call the specified event listener. It is just like 'onclick' keyword in JavaScript.
3. once(): once(event, listener), by this method the event is called for one time and after that it will be removed. 
4. addListener(): addListener(event, listener), by this method the event is checked if it is registered or not.
5. removeListener(): removeListener(event, listener), by this method the event is removed for listener.

## Example:
```
const EventEmitter = require("events")
const emitter = new EventEmitter()
emitter.on("message", (arg) => {
  console.log("subsribed", message)
})
emitter.emit("message", "Welcome to my blog.")
```

###### From the above example, we can say that EventEmitter is a built-in class of event in Node JS. Normally, we declare our variable name with lower case at start, but here we should start with upper case letter in declaring event emitter. When we import 'events' class where methods are written. After creating an object, we can access these methods. So, 'emitter' is a object of that particular class, and it accesses the on() method and emit() method over there. 

## **Use Case**
At first, create a file named "timer.js". The code will be the following example given below.

```
const EventEmitter = require("events")
class Timer extends EventEmitter {
  closeIt('close', msg) {
    this.emit('close', msg)
  }
}
module.exports = Timer
```
###### Here, we can see, Timer extends the EventEmitter class and the method called closeIt takes event and message as an argument.

Now create 'app.js' file and write this code.
```
const Timer = require("./Timer")
const timer = new Timer()
timer.on("close", arg => {
  console.log("Listened value: ", arg)
})
timer.closeIt("close: ", 'Time out ! Server will be closing soon...')
```
###### Here, it requires the module Timer and instantiates the class as a timer. closeIt() function emits event called 'close'. The listener will listen for the event and close it.
How I Made an API for Duck Jokes 🦆
Tags: webdev, node, showdev, opensource
Published: 2021-12-28 20:27:58

I've been working on my website for some time now, but it felt like there was something missing. I wasn't really sure what it was, so I ignored it for a bit of time. Later that week, I was hanging out with friends and we started making puns about ducks- "wisequacks". That's when I had a moment of realization. 

I decided to drop everything that I was doing and build a really simple API for duck jokes. Right now the API has a couple of jokes, but we need some more, so if you want to submit some, you can respond to [this issue](https://github.com/fairfield-programming/backend-server/issues/66) or you can just drop a pull request on [this repository](https://github.com/fairfield-programming/backend-server). 

You can check out the joke API [here](https://fairfield-programming.herokuapp.com/joke) and you can use it in any of your projects if you would like. All of the code for the project can be found in the linked repository and it is all under the MIT license if you want to use it in your own project. Cheers! 

_Make Sure to Drop the Repository a Star if You Like It!_

[Fairfield Programming Association's Backend Server](https://github.com/fairfield-programming/backend-server/)
In Pursuit of a Career Identity As A Modern IT Professional
Tags: growth, computerscience, careerdevelopment, career
Published: 2022-05-04 14:56:35

---
title: In Pursuit of a Career Identity As A Modern IT Professional
published: true
date: 2021-12-28 20:19:25 UTC
tags: growth,computerscience,careerdevelopment,careers
canonical_url: https://medium.com/@stojay008/in-pursuit-of-a-career-identity-as-a-modern-it-professional-7f820e973abc
---

[![](https://cdn-images-1.medium.com/max/880/0*_mCeaYX7opB1TAVV.jpg)](https://medium.com/@stojay008/in-pursuit-of-a-career-identity-as-a-modern-it-professional-7f820e973abc?source=rss-7a0eddc3a9a5------2)

2021 is a year that I achieved several new career heights in my business. I registered an LLC business in the USA, gained more valuable IT…

[Continue reading on Medium »](https://medium.com/@stojay008/in-pursuit-of-a-career-identity-as-a-modern-it-professional-7f820e973abc?source=rss-7a0eddc3a9a5------2)
How to version Docker Images?
Tags: docker, devops, git, tutorial
Published: 2021-12-28 19:47:37

> If we use git for version management of our code base, similarly we can use Docker as our version management tool for applications.

Lets imagine, we have an application called "**Icecream**".

We are going to store our "Icecream" application on a repository named "**Fridge**" so, lets get the root access by executing the command 

```
sudo -i
```

- First we need to login to our repository called "**Fridge**"
```
docker login Fridge
```

- Now pull the "**Icecream**" image from our "**Fridge**" 
```
docker pull Fridge/Icecream:plain

// syntax: docker pull repo_name/Image_name:version_tag
```

- If we don't have a docker image named "**Icecream**", on our "**Fridge**" repository, then lets build one

```
docker build -t Icecream:plain
// this command is executed from the working directory where our docker file is placed
```

- Now as we have our "**Icecream:plain**, lets modify it to "**Icecream:vanilla**" and "**Icecream:chocolate**".

- For that we need to run our Icecream:plain in to a container

```
docker run -it Icecream:plain bash
```

- Add the code for **vanilla** in our container and do

```
docker ps
```

- copy the container id of the running container and commit

```
docker commit <container_id> Icecream:vanilla
```
- Now run our "**Icecream:plain**" in to a container again

```
docker run -it Icecream:plain bash
```

- Add the code for **chocolate** in our container and do

```
docker ps
```

- copy the container id of the running container and commit

```
docker commit <container_id> Icecream:chocolate
```

- Now push the changes to your "**Fridge**" repository

```
docker push Icecream:vanilla
docker push Icecream:chocolate
```
Explore us more on : [Doge Algo 🐶](https://dogealgo.netlify.app/)

**Support Us on** [Buy Me a Coffee](https://www.buymeacoffee.com/dogealgo)
Deploy CockroachDB in a  DigitalOcean Kubernetes Cluster
Tags: kubernetes, digitalocean
Published: 2021-12-28 19:36:00

For the [DigitalOcean Kubernetes Challenge](https://www.digitalocean.com/community/pages/kubernetes-challenge), I wanted to deploy a database to a managed Kubernetes cluster, and decided to go with [CockroachDB Core]( https://www.cockroachlabs.com/docs/stable/install-cockroachdb.).

The process to deploy on Kubernetes was simple. I just followed the instructions in [CockroachDB official documentation](https://www.cockroachlabs.com/docs/v21.2/deploy-cockroachdb-with-kubernetes.html,), with just one change - In ["Step 1. Start Kubernetes"](https://www.cockroachlabs.com/docs/v21.2/deploy-cockroachdb-with-kubernetes.html#step-1-start-kubernetes), instead of using hosted GKE or EKS (as mentioned in the docs), I used DigitalOcean's [Managed Kubernetes](https://www.digitalocean.com/products/kubernetes/) service.

So my "Step 1. Start Kubernetes" was basically:

- 
[How to Create Kubernetes Clusters Using the Control Panel](https://docs.digitalocean.com/products/kubernetes/how-to/create-clusters/) from DigitalOcean. I created a 3 node cluster with s-4vcpu-8gb droplets. You should be able to do it with slightly smaller droplets too.

Rest of the steps were as mentioned in the doc:

- [Step 2. Start CockroachDB](https://www.cockroachlabs.com/docs/v21.2/deploy-cockroachdb-with-kubernetes.html#step-2-start-cockroachdb)
- [Step 3. Use the built-in SQL client](https://www.cockroachlabs.com/docs/v21.2/deploy-cockroachdb-with-kubernetes.html#step-3-use-the-built-in-sql-client)
- [Step 4. Access the DB Console](https://www.cockroachlabs.com/docs/v21.2/deploy-cockroachdb-with-kubernetes.html#step-4-access-the-db-console)
- [Step 5. Stop the cluster](https://www.cockroachlabs.com/docs/v21.2/deploy-cockroachdb-with-kubernetes.html#step-5-stop-the-cluster)
Content-Security-Policy (CSP) warning in Electron – how to disable it?
Tags: electron
Published: 2021-12-28 19:22:28

There might be plenty of reasons why we do not want to defined stuff within **package.json** one one them – flexibility, dedication for yoga ? Hmm maybe , whichever the reason would be let's go remove CSP warning – there least two ways to do so :

---

### <u>Disable through CLI</u>

Consider running Electron's app source file main.js within CLI as so: `ELECTRON_DISABLE_SECURITY_WARNINGS=true npx electron main.js`

> Hereby using **npx** I did consider you was clever and installed Electron locally beforehand .

### <u>Disable through the process</u>

Define <u>anywhere (_top-level would be at best_)</u> the following  ```javascript
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS']=true
```

---

<u>Useful references</u>

- [Electron Security warnings](https://www.electronjs.org/docs/latest/tutorial/security#electron-security-warnings)
- [Two ways to launch Electron](https://dev.to/projektorius96/two-ways-to-launch-electron-app-enf)
- [Package.json practical side](https://dev.to/projektorius96/packagejson-practical-side-clarified-13id)
convert website to windows app and android app in a few minutes for free
Tags: webdev, javascript, programming, beginners
Published: 2021-12-28 19:21:01

Today we present [urlgapp](https://www.urlgapp.com/) - a tool designed to convert your url to windows app and android app in a few minutes 🖥️ 📲

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

**Android**

Features that we are provide for android app 

Apk & App bundle
Google play Key
Media permission
Dialog Ask to exit app
Internet connection error . native page
Android native spinner
Do you have any example for this tool in google play ❓
yes we have you can download it from here
https://play.google.com/store/apps/details?id=com.urlgapp.app1635406887441
it’s very simple app

why you add a media permission ❓
urlgapp doesn`t know what type of website it you but if your user upload or download any file without any permission google play will remove your app from store so, we have added it by default to make sure your app is safe on google play

**Windows**

**very important hint for windows app**
we are use iframe in windows app so you need to make sure your website allow iframe cross domain if you try https://youtube.com or https://facebook.com or any of the popular website it will show white screen that mean this websites not allow any one to use their website out of their domain so please make sure to allow iframe cross domain

If you have any question, feel free to ask

check it now

https://urlgapp.com

next topic will be convert you code file html , css ,js to windows app to avoid the iframe cross domain 💖
All about Microsoft Imagine Cup 2022
Tags: imaginecup, microsoft, 2022
Published: 2021-12-28 19:12:28


The 2022 season of the Imagine Cup opens with the Epic Challenge. Participation is optional, but highly encouraged to support you in developing your project for the Online Semifinals or National Finals. By getting involved, you have the chance to outline your project proposal and pitch to get early feedback without a working proof of concept.


**What to do?**

![What to do](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82mt2bsy4nf0tdw7jev7.png)

**Roadmap**

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


**Timeline**

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

**Imagine Cup Resources**

0. 
Website 0: https://imaginecup.microsoft.com/en-us/Category/16

1. 
Website 1: 
https://imaginecup.microsoft.com/en-us/Country/US

2. 
Website 2: 
https://imaginecup.microsoft.com/en-us/Home/Registered/0


3.Imagine Cup Competition Rules & Regulations (PDF):  https://www.aka.ms/ICRulesRegs

4.Imagine Cup Code of Conduct (PDF): https://aka.ms/IC22CodeofConduct

5.Imagine Cup Training Content: https://aka.ms/ICTrainingContent

6.Blog Website : https://techcommunity.microsoft.com/t5/student-developer-blog/bg-p/StudentDeveloperBlog

7.GitHub Repository: https://github.com/microsoft/ImagineCup/blob/main/README.md

8.Microsoft Imagine Cup account: https://imaginecup.microsoft.com/en-us/dashboard

9.Why Compete?: https://imaginecup.microsoft.com/en-us/compete/whycompete



**Queries**
0.FAQ: https://imaginecup.microsoft.com/en-us/support/faq

1.Frequently asked questions for getting started in the 2022 Imagine Cup: https://techcommunity.microsoft.com/t5/student-developer-blog/frequently-asked-questions-for-getting-started-in-the-2022/ba-p/2998672


**Winners**

0. Previous Year Winners: https://imaginecup.microsoft.com/en-us/finalists/team#2021

1.Meet the 2022 Imagine Cup Epic Challenge winners : https://techcommunity.microsoft.com/t5/student-developer-blog/meet-the-2022-imagine-cup-epic-challenge-winners/ba-p/3029957



**Categories**

0.Explore the 2022 Imagine Cup categories: https://techcommunity.microsoft.com/t5/student-developer-blog/explore-the-2022-imagine-cup-categories/ba-p/3034164

1.2021 Imagine Cup category feature: Earth: https://techcommunity.microsoft.com/t5/student-developer-blog/2021-imagine-cup-category-feature-earth/ba-p/2191840

2.2021 Imagine Cup category feature: Education: https://techcommunity.microsoft.com/t5/student-developer-blog/2021-imagine-cup-category-feature-education/ba-p/2194622

3.2021 Imagine Cup category feature: Healthcare: https://techcommunity.microsoft.com/t5/student-developer-blog/2021-imagine-cup-category-feature-healthcare/ba-p/2197968

4.2021 Imagine Cup category feature: Lifestyle: https://techcommunity.microsoft.com/t5/student-developer-blog/2021-imagine-cup-category-feature-lifestyle/ba-p/2200906


**Story**

0.Imagine Cup Microsoft Asia Stories: https://news.microsoft.com/apac/tag/imagine-cup/
Unpacking pButtons with Yape - update notes and quick guides
Tags: performance, devops, python, practice
Published: 2021-12-28 19:05:12

If a picture is worth a thousand words, what's a video worth? Certainly more than typing a post.

Please check out my "Coding talks" on [InterSystems Developers YouTube](https://www.youtube.com/c/InterSystemsDevelopers):

<p style="margin-left: 40px;">
  1. <a href="https://youtu.be/3KClL5zT6MY">Analysing InterSystems IRIS System Performance with Yape. Part 1: Installing Yape</a>
</p>

 

Running Yape in a container.

<p style="margin-left: 40px;">
  2. <a href="https://youtu.be/cuMLSO9NQCM">Yape Container SQLite iostat InterSystems</a>
</p>



Extracting and plotting pButtons data including timeframes and iostat.

<!--break-->

If you need a simple way to capture and review Caché and IRIS and systems performance metrics you can do this quite easily by scheduling pButtons to run every day. [I have written about this before.](https://community.intersystems.com/post/intersystems-data-platforms-capacity-planning-and-performance-series-index)

I regularly need to review customer systems for capacity planning and performance reviews, which is why I wrote Yape and made it available on [GitHub](https://github.com/murrayo/yape "GitHub"). My InterSystems colleague, Fabian, took the internals of Yape in new directions and [formalised running it in a container](https://community.intersystems.com/post/visualizing-data-jungle-part-iv-running-yape-docker-image). Fabian has since left InterSystems, but I have carried on the open source development on GitHub. Over the last month or so I have fixed up errors that occurred with some operating system command formats, made date handling smarter, added a "Total CPU" chart to vmstat (looking at "id" upside down was giving me neck strain), and other cosmetic changes.

If you want to contribute to Yape, it is open source on GitHub. If you have requests for features let me know [via the suggestions page](https://github.com/murrayo/yape/issues).

In addition, please check [Yape Application on Open Exchange](http://bit.ly/2WnqmSt).

In the next few months, I will share some other tips from my workflow and expect to continue development to make the data presented more useful. Yape is great for reviewing and looking at trends of what happened yesterday or over the last week, but you also need monitoring and alerting in real time... I am teasing here for some future posts as well ;)
position 
Published: 2021-12-28 19:00:04

{% codepen https://codepen.io/moonlxght10/pen/MWErRzq %}

`left:rem;`
pushing from left `->`
{% codepen https://codepen.io/moonlxght10/pen/XWeVQGG %}

```css
.box-2{
    background-color: tomato;
    /* ⚜️> */
    position: relative;
    left:5rem;
    bottom: 4rem;
    /* <⚜️ */
}
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ka6xgn3cgialx4bbpb1g.png)

`z-index: -1;`
```css
.box-2{
    background-color: tomato;
    /* ⚜️> */
    position: relative;
    left:4rem;
    bottom: 4rem;
    z-index: -1;
    /* <⚜️ */
}
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tdmyrab8fcvq2k5rl1n9.png)

`z-index: 1;` 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sv5k0dg8ctxv7wybwxod.png)
Quick, Easy, & Free* Tools to up your Security Game
Tags: security, log4j, thinkstcanary, yubikey
Published: 2021-12-28 18:45:40

Minimal effort security enhancements to _Prevent-Detect-Respond_ to the wide range of cyber threats posing a risk to your business and personal privacy.

[**YubiKey**](https://www.yubico.com/)
Social Engineering and phishing attacks remain the most common vector of attack to capture credentials, in addition to the constant threat of identity based attacks (ie. credential stuffing, etc.). YubiKeys are the best available solution to provide strong _(something you have)_ authentication leveraging the industry standard FIDO2  (WebAuthn and U2F) protocols. YubiKey supports Second Factor, Multi-Factor, and Passwordless use cases; example below is the second factor prompt from a Yubikey 5 Nano. *Yubikeys are roughly $20-$50 each depending on the model. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z7d0a3k7bmuakixrdpuz.png)

[**phish.ly**](https://phish.ly/)
phish.ly offers a free service to scan suspicious emails with [urlscan.io](https://urlscan.io/) via the robust [Tines.io](https://tines.io/) automation platform. This is not a _panacea_ solution, as it is currently limited to suspicious URLs, but offers a valid alternative for users looking for an additional level of assurance for their personal Google Workspaces or ProtonMail accounts that do not have email security gateways due to budget or license constraints.

[**Canary Tokens**](https://www.canarytokens.org/generate)
_High Fidelity_ Intrusion Detection is one of the hardest tasks to seamlessly accomplish in the continuous battle to _Identify_ and _Contain_ active security incidents. Canary Tokens create the ability to generate a number of detection sources in the event a bad actor has compromised a system. This can include “canary” Word and Excel Documents from a client filesystem, AWS Access/ Secret Keys, SQL server, kubeconfig tokens, and DNS tokens*.

[Thinkst Blog](https://blog.thinkst.com/p/canarytokensorg-quick-free-detection.html)

Thinkst provides free Log4Shell tokens to provide a level of assurance in testing for applications vulnerable to the recent Log4j vulnerability (CVE-2021–44228). **This guidance is specific to the scope of only initial testing for applications that are potentially vulnerable to the [Log4j vulnerability](https://nvd.nist.gov/vuln/detail/CVE-2021-44228). Additional mitigation and remediation guidance can be referenced from [CISA](https://www.cisa.gov/uscert/apache-log4j-vulnerability-guidance).

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