teleren/devto huggingface dataset:
JavaScript Social Auth with modal window
Published: 2021-03-03 12:19:53

Hi, I'm going to explain how to implement social auth with modal window on Vue but can work on any other JavaScript Framework event in native JS.

The problem here is that when the modal window has been opened we loose the control to listen any event or request token when login or register is success. 

We must think some way to receive an event when login is success and thus be able to recover the token, this event maybe launch from our back.

Let's go by parts.

# Open modal

I'll asume that you know how to open a new window in JavaScript, so I'm not going to explain it in deep.

```javaScript
//This is my object with configurations for new window. 
window = null;
defaultOptions = {
    width: 500,
    height: 500,
    menubar: "no",
    resizable: "no",
    location: "yes",
    scrollbars: "no",
    centered: true,
  };

/
login(){
   const url = 'https://www.OurSocialAuthEndPoint.com'

   //When login is called open window is opened
   this. window = window.open(
    url, 
    null, 
    this.optionsToString(this.popupOptions)
   );
}

//Map the object with window options into string.
optionsToString = options =>
    Object.keys(options)
      .map(key => `${key}=${options[key]}`)
      .join(",");
```

Well, the modal window open with our social login page, now we need to know if the user has registered.

# Emit event.

In my case when user logged the back save it, and emit a `JWT` token that have to save in front-end as Cookie.

The problem is that JavaScript doesn't allow listen event on windows with other domain.

The solution I suggest is that pass token generated for the back-end by `message` event and our front-end will be listening that event.

My back emit a callback response, and emit `postMessageEvent` with token value.

In this way when callback page loads the `message` event will send and his value is the generated token.


# Listen event

Once the event is send, we need to listen the event to capture the value that must be the token.


```javaScript
 token = null;
login(){
  //...open modal window code

onFetchToken();

saveToken()

this.window.close;
}


onFetchToken() {
   //Listen the message event to capture token.
  window.addEventListener("message", event => {
    const { data } = event;
    this.token = data.token
    });
  }
```   

The code above can look like correct but, is incorrect, because the event does't happens immediately, and we will save a null token and window will close but the user have't registered.

The solution is wait for the event occur asynchronously. For those we are going to use `Promise`, the promise is resolve only when the event occur and the window won't close.

```javaScript
//Remove token property

login(){
  //...open modal window code

  let token = await this.onFetchToken();

  saveToken(token)

  this.window.close;
}

onFetchToken() {
    return new Promise(resolve => {
      window.addEventListener("message", event => {
        const { data } = event;
        resolve(data.token);
      });
    });
  }
```
Communication with e-RT3 Plus (remote)
Tags: ert3, ssh
Published: 2021-03-03 12:18:11

## Connecting to e-RT3 Plus from browser
The browser based connection allows the user to perform limited tasks like monitoring the device and CPU settings.

---

## Establishing browser based connection by e-RT3 Plus

In order to establish a browser based connection, the user must be aware of the IP address and should belong to same network.

### Steps
1. Make sure you belong to the same network as the device.
2. Type in the IP address of e-RT3. (By default, 192.168.3.72). It opens the website which looks like the following image.
3. Now the user can perform tasks like monitoring the device and CPU setting

![home](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gbhuxhirl1a8i274jdf.PNG)

This is how the user can access the device through a browser

---

## Communicating  with e-RT3 Plus by SSH
With the help of SSH connection, user can perform many tasks. But in order to connect by SSH, user needs to have PuTTY installed in their system and should be aware of the IP address and the login credentials of the device.

---

### Establishing SSH connection to e-RT3 Plus
### Steps

1. Make sure you belong to same network as device.
2. Open PuTTY and type in the IP address of e-RT3. (By default, 192.168.3.72) and hit enter.

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

3. When establishing connection for the first time, the PuTTY Security Alert dialog is displayed. Click “Yes” to continue.

![security](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kw87z30zn2fjlj6uwijg.PNG)

4. Now it will ask for user id and password. Enter the user id and password. But only normal user can access e-RT3 Plus with SSH with the default settings.

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

5. Now the user is good to perform different tasks.

   User can perform tasks like 
   1. adding new user (only with root access),
   2. deleting user (only with root access),
   3. changing password (only with root access),
   4. installing applications (only with root access),
   5. updating the applications (only with root access),
   6. create new folders,
   7. deleting the folders,
   8. copying a file,
   9. moving a file, etc. 

The SSH connection provides the safest communication between the user and the device and it is most preferred by developers. The browser based connection has limited tasks that can be performed. But both connections let the user to connect to e-RT3 Plus easily.

---
I wish there was an intensive course where we only focus on working with objects, arrays, and solving real-life problems.
Tags: discuss
Published: 2021-03-03 11:25:51

I may have not expressed myself properly from the title. But most of the time as front-end devs, we need to work with objects and arrays. I wish there was a course/tutorial only focusing on solving real-life problems with objects and arrays. Writing clean functions to extract, filter, combine objects/arrays to come to the real solution. 

I hope I could made my points clear.
Experience with learning to program
Published: 2021-03-03 11:23:13

Hi all, I hope this is the right place for this stuff, if not please say so! I’m creating a platform to help developers to keep learning during their work. Currently, you often have to follow a course or figure stuff out while working. My goal is to make learning a part of this process of “figuring stuff out”. This way, I want to make learning more relevant, make it easier to stay up-to-date and make courses largely unnecessary. To validate my idea, I want to gather experiences from the development community. Therefore I was wondering if you would be willing to fill in this 8-minute questionnaire? Additionally, I would be really interested in your experiences with programming tutorials and courses! 

The survey: https://forms.office.com/Pages/ResponsePage.aspx?id=DQSIkWdsW0yxEjajBLZtrQAAAAAAAAAAAAZ__sciwdZUMzYzWEg0MDM2M0lVMDhOWEVCNk5LQzhGTS4u
Old Giant Altcoins 2017 vs Altcoins 2021
Tags: ethereum, defi, blockchain, cryptocurrency
Published: 2021-03-04 06:08:46

---
title: Old Giant Altcoins 2017 vs Altcoins 2021
published: true
date: 2021-03-03 11:22:05 UTC
tags: ethereum,defi,blockchain,cryptocurrency
canonical_url: https://medium.com/coinmonks/old-giant-altcoins-2017-vs-altcoins-2021-1e95a7e68e17
---

[![](https://cdn-images-1.medium.com/max/780/0*3441HSufpPlqDPhr.png)](https://medium.com/coinmonks/old-giant-altcoins-2017-vs-altcoins-2021-1e95a7e68e17?source=rss----721b17443fd5---4)

Are you wondering if there is a bubble in the crypto market right now? The answer is given by the many unicorns

[Continue reading on Coinmonks »](https://medium.com/coinmonks/old-giant-altcoins-2017-vs-altcoins-2021-1e95a7e68e17?source=rss----721b17443fd5---4)
Бизнес логика в Rails приложениях
Tags: rails, ruby
Published: 2021-03-03 11:21:58

Для многих не секрет, что Ruby on Rails — это фрэймворк, основанный на паттерне Model-View-Controller.

И не смотря на то, чтоRails позволяет решать огромное количество задач, данный паттерн становится нежизнеспособным в больших проектах, особенно в проектах с быстро меняющейся бизнес логикой. Решением данной проблемы может стать внедрение еще одного слоя, который вынесет бизнес логику из моделей.
О том как мы в решаем эту проблему можно прочитать тут: [https://blog.rnds.pro/010-interactor](https://blog.rnds.pro/010-interactor?utm_source=devto&utm_medium=post)


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5kepp90vzabuqaxw6tvz.png)
What changes can mixed reality UIs bring to webdev?
Tags: discuss, watercooler
Published: 2021-03-03 11:15:28

I'm pretty sure you watched Microsoft Ignite 2021 yesterday and if you didn't you might find it interesting.

When I was watching the show I was wondering if those UIs could change our concepts in webdev, in how we do UIs on desktop and mobile or if the field will become main stream or at least heavily adopted.

When mobile came into the ecosystem, we adapted and started launching our websites and webapps with responsive design to the point that today we code following "mobile first" practices.

Do you think that at some point we will be able to talk about "mixed reality first" or "view compatible with mixed reality UI"?

Will there be designers and front ends moving from webdev to mixed reality? (Perhaps this is already happening).

Perhaps the concept of "Full Stack" will expand even further to encompass VR/AR content as well?

What are your bets in this field?
an open source and pure Node.js RPC framework project
Tags: javascript, typescript, node
Published: 2021-03-03 11:15:00

i created a new open-source project on github.

it is written in TypeScript , based on Node.js API.

jigsaw.use API is similar to koa API so you can create a JSON-RPC middleware extension to make it support JSON-RPC.

welcome your contribution!

https://github.com/ZhyMC/jigsaw-rpc
How to manage dotfiles with a Git bare repository
Tags: git, opensource
Published: 2021-06-09 10:22:00

---
title: How to manage dotfiles with a Git bare repository
published: true
date: 2021-03-03 11:06:08 UTC
tags: git,OpenSource
canonical_url: https://daniele.tech/2021/03/how-to-manage-dotfiles-with-a-git-bare-repository/
---

How to track your dotfiles with git, easily and share with other installation.

The post [How to manage dotfiles with a Git bare repository](https://daniele.tech/2021/03/how-to-manage-dotfiles-with-a-git-bare-repository/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
How much of a life should I have as a student?
Tags: beginners, discuss, college, student
Published: 2021-03-03 10:49:41

I must preface this with, *nobody* really has a life at the moment but in general:

What should my day look like if I'm doing software development? 

Study and that's it?

Should I be pulling apart code all day?

Am I supposed to be at this stuff from morning 'til night?

Not complaining, just genuinely curious 😂
Got featured on Product Hunt🎉
Tags: productivity, design, webdev, laravel
Published: 2021-03-03 10:48:32

Greetings Everyone😊,

I was a freelance web designer for 2 years and a lot of my time would involve cool looking websites. Often, I’d use a tool like Evernote to capture great designs and write notes about them. These notes usually involved the color palette and fonts used. It got extremely tedious continually ‘inspecting’ websites and typing up notes - I really didn’t have the time. Then is when I thought about building a micro-SaaS app(yizy.io) that can solve this.

[Yizy](https://yizy.io/) uses a web browser extension to bookmark a website, take a screenshot of the current page and automatically pull in relevant information, such as color palettes and CSS property, from the page source. It also allows you to put both Comment and CSS annotations on your screenshots and images. The CSS annotation includes CSS properties of any selected part of a web page being screenshot (pulled automatically from the website).

On your dashboard, you will see three Categories: Inspirations, Sources and Collections. Any screenshot or image uploaded on [Yizy](https://yizy.io/) is found in Inspirations. The URLs (website addresses) saved can be found in Sources. Collections is like a folder for Inspirations (e.g. Images) and Sources (e.g. URL) you wish to save in. Every Inspiration, Source, or Collection is taggable and can be easily searched in the “Search” toolbar by either Keyword or Tag or both.
I really appreciate your feedback and taking the time to check it out!
https://www.producthunt.com/posts/yizy
6 Best URL Shorteners To Shorten Long URL’s & Track Links for 2021
Tags: urlshorteners
Published: 2021-03-03 10:29:32

Have you ever tried to share a link to your latest blog post and realized it was long, and ugly, and exceeded the Twitter character count?

Me too. And I’ll tell you, nobody wants to click on a link like that even if it does fit the character count.

The truth is, shorter URLs are always better. They’re nicer to look at, provide a better user experience for customers and social media followers, and are super simple to get. You just have to know how.

Ever since Google URL Shortener shut down in March 2019, the internet has been searching for the next best option. There’s no single correct answer, as the right service for you ultimately depends on your needs and expectations. There are simple and fast free shorteners for use in a hurry, shorteners with comprehensive dashboards and tracking tools for brands, and even URL shorteners you can host on your own website.

To help you find the best URL shortener services, we’ve compared the leading providers and how they stack up against one another.

That’s why today we’re going to share with you the **top URL shorteners around**, so you can pick the one that best suits your link sharing needs.

### The 6 best URL shortener services

[Bitly](https://bitly.com/) for the best all-round URL shortener

[BL.INK](https://www.bl.ink/) is a full-featured URL shortener tool that comes with a beginner-friendly dashboard for tracking link activity.

[Polr](https://polrproject.org/) for a minimal self-hosted URL shortener

[TinyURL](https://tinyurl.com/) for fast and anonymous short URLs

[Yourls](https://yourls.org/) for a highly customizable self-hosted URL shortener

[Clset](https://clset.com) for automatically creating links

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

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

### Choosing the best URL shortener for you
It’s important to remember that not all URL shorteners are the same.

Shorby is the best all-round link shortener thanks to its deep feature set and powerful analytics. It’s especially useful for bloggers, small businesses and content creators thanks to its social media landing pages.

If you just want a straight up free URL shortener, Bitly is your best option. Their free offering is great but its also ideal for enterprise customers.

For casual users who need a quick and easy link shortener solution, consider TinyURL.

And there you have it! The top URL shorteners available right now. And the best part is, no matter what your link shortening needs are, there’s a tool to satisfy it.

Whether you’re looking for a feature packed tool, a free URL shortener or an alternative to the Google URL shortener that’s no-longer available – you’ll find something here to fit your needs.
What you hate the most about being a Developer? 😅🤓
Tags: discuss, watercooler, webdev
Published: 2021-03-03 10:14:52

---
title: What you hate the most about being a Developer? 😅🤓
published: true
description: Most hated things being a developer 
tags: discuss, watercooler, webdev
---

Well though being a developer is awesome, but there is always something. So what is that one thing that you don't like being a developer? and why so?

![](https://media.giphy.com/media/3o7qDP28LG5LrVYfde/giphy.gif)
We Need YOU! I'm Integrator9004, and I encourage women devs in 2021!
Tags: wecoded
Published: 2021-03-03 09:58:38

##I was born to tech

I was lucky my father bought me a Video Genie (Tandy clone for those old enough to remember the TRaSh-80) and was in a school with one of the first personal computers.  I learned assembler, machine code, basic, COBOL, Fortran none of these fancy libraries to pull in, you wrote everything.  I even had to get the soldering iron out to create a box to link the computer to a printer and write the drivers to tell the printer which heads to fire to draw a letter because there were no USBs then.  

Fast forward to 2010 when I joined QinetiQ to lead a bunch of penetration testers.  These boys (and it was a boys club) where the sort of geniuses you wouldn’t put in front of a customer.  Highly technical, dedicated and insular.  I knew we had to break this.  We needed different thinking, we needed a broader pool of talent, we needed equality, we needed to encourage the brightest minds and guess what, they are not always men.  I highly recommend a film called “Hidden Figures” which shows the women “computers” behind putting men on the moon.  Boy does it frustrate me the way people were treated.  To my mind, it is completely alien to distinguish between race and gender.  “We all bleed the same colour at NASA”.
  
How to attract the top talent?

Would you want to join a boys club locked up in a room full of tech and boys toys?  I needed to break down the stereotypical image and make the penetration testing practice attractive to women.  It had to become a place where women wanted to join in and flourish.  Women needed to know we are welcoming, that the work is interesting and there is a great career path.  What was interesting, was we had a lot of women working in the Human Factors department who also reported to me.  A complete contrast to the male only penetration testers.   I also had the cyber-security consultants to draw on so I brought the three teams together into a workshop to start creating a new identity as one team.  They came up with the title of the CSIs, Cyber Security and Influence.  The conversations allowed for open dialogue and a better understanding of what each area offers.  I also had the opportunity to talk at the Cyber Security Challenge where we met some of Britain’s greatest hacking talent.  Wherever I can, I evangelise to anyone who will listen as to the fun that can be had working in cyber security.  Not too long after opening up these dialogues, we had our first ladies asking to join the penetration testing team.  I think this is key, opening up dialogue, demonstrating that our industry has a lot to offer, challenges, personal development, career growth.  There are so many facets to cyber security that anyone with an interest can find a role.  

My Message for Others
There’s a lot of fun to be had in cyber security.  Be curious, and find a mentor that will help you achieve your aspirations.

[Link](https://sr-content-ok2nbdvvyp8jbrhdp.stackpathdns.com/4112016182439.jpg) Margaret Hamilton nasa's lead software engineer
Understanding Kubernetes: part 39 – Pod Security policies
Tags: kubernetes, devops, docker, beginners
Published: 2021-03-03 09:53:20

---
title: Understanding Kubernetes: part 39 – Pod Security policies
published: true
description: Serie of sketchnotes about Kubernetes. Explaining in a visual way Kubernetes principles.
tags: Kubernetes, DevOps, Docker, beginners
series: Understanding Kubernetes in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/85k1t1cb51tie2tf3er5.jpeg
---

Understanding Kubernetes can be difficult or time-consuming. In order to spread knowledges about Cloud technologies I started to create sketchnotes about Kubernetes. I think it could be a good way, more visual, to explain Kubernetes (and others technologies).

We continue the serie of Sketchnotes about Kubernetes, with an explanation about PSP, not the video game console but the Pod Security Policies ^^

I Know Pod Security Policies (PSP) will be deprecated in Kubernetes 1.21 and be removed In Kubernetes 1.25, but it's interesting to know them.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/85k1t1cb51tie2tf3er5.jpeg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/to10umjenz6h7wiv1mmk.jpeg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8khora2eji6w1no1jwm.jpeg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obrdkgirl6ooya3uc8tz.jpeg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x8jbzmh0dvffgg8tpsow.jpeg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0odxfikk1ufovp8wqgo.jpeg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lxyycjhzka1b9jrpoczz.jpeg)



If you are interested, I published all the sketchnotes on Kubernetes (and new ones!) to make a "book" of 120 pages: ["Understanding Kubernetes in a visual way"](https://gumroad.com/aurelievache#uCxcr).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
FEC Day 8
Published: 2021-03-03 09:31:17

Today started off productive with a team meeting to go over high-level data management. We needed to make sure we were putting data in the right areas and had to be clear with each other who needed what kind of data. I was able to get through the grid garden website to become more comfortable with css grids but now I need to also do the flex box option. Once I finish that I can make a decision on what I want to use for my reviews. I was stuck doing insurance stuff for a few hours so that was a roadblock today that I wasn't expecting. I'm starting to feel really behind so I need to really get coding!
Which book did you read for "Data Structures Through C"? [When you were studying?]
Tags: discuss
Published: 2021-03-03 09:26:48

I was discussing with my college buddy last week and in the nostalgia mode, we were discussing professors, other batchmates and then books. 

That gives me recall that in India, our professor suggested two books for **Data Structures Through C**

1. [Data Structures Through C by Yashavant Kanetkar](https://bpbonline.com/products/data-structure-through-c-3nd-edition-book-ebook)
2. [Data Structures Using C by E. Balagurusamy](https://www.goodreads.com/book/show/25531254-data-structures-using-c)

Which one you have read?
FEC Day 7
Published: 2021-03-03 09:23:34

Today we were given a surprise update with the requirements from the client. We now need to keep track of the amount of times each widget is clicked and the time of click. This was a big wrench in our plans because now we had to do research and discuss how we wanted to implement this feature. We decided that it would be as simple as wrapping our components in a higher order component, which is something we can easily implement at a later time. I got my skeleton done for the last two sections but spent time working on my TA which was another wrench in my plans. I really need more time to spend coding out my section.
StatefulSet in Kubernetes Explained | Deployment Vs StatefulSet
Tags: kubernetes, statefulset, devops, techtalks
Published: 2021-03-03 09:23:15

Statefulset component is used in Kubernetes to deploy Stateful Applications. Deploying Stateful Applications is not staright forward as Stateless Applications. 

These complications are discussed in this video and how Statefulset helps you in deployment of such applications in a right way. Just watch this video.

{% youtube Oph_teIRwpU %}