teleren/devto huggingface dataset:
How to make a Telegram bot using Node JS?
Tags: node, telegrambot, javascript
Published: 2020-05-11 09:30:49

As I recently released a telegram bot, I got frequently asked about a tutorial. I think, it's probably easy to code something when you get the right documentation but I faced hard time learning how to build telegram bots using node js. So here's a quickstart tutorial. I am going to use Telegraf API for it, I found it the easiest. Though you can try others as shown on telegram.org.

1. Register a bot.
2. Telegraf API
3. Deployment.

Firstly, open telegram and search for BotFather (yes, it's a bot). BotFather will be used to manage, register and edit all your bots. Type /newbot to start the procedure of registering your first bot. Give required information, choose the username wisely, though you can edit the rest later. At the end of it, BotFather will provide you with the token to send https requests, save that somewhere.

Now bootstrap a new Node JS project and based on your requirements/proficiency add the libraries. Install the Telegraf NPM package by "npm i telegraf". It's time we write some code!

Copy/paste the code below.

const telegraf = require('telegraf');
const bot = new telegraf('----YOUR--TELEGRAM--TOKEN----');

Now you have initialized your script to talk to the bot associated with the token. Quickly, enter the below given code to your code editor and read the comments to understand it.

bot.start((ctx) => ctx.reply("Hello your are talking to king of all bots!"));
//the above line runs when a user interact with the bot for the first time or //type /start. Everything that goes into ctx.reply("message goes here") will be //sent as a message to the user by the bot.
bot.hears('hello', (ctx) => {
ctx.reply("Heyya! I am the kind.")
});
//bot.hears waits for the user to pass in a keyword that triggers a message or //action by the bot. It accepts the first parameter to be a keyword and then an //arrow function which has ctx.reply

Amazing, now we have a bot that sends some message when starts and reply on the work "hello". You can test it by doing "npm start" and trying the keywords in telegram. Works fine? Good.

Till now, we were hosting the bot locally but we want anyone to access it anytime. So now we need to deploy it to some cloud servers. Heroku is a free service that lets you host your Node JS projects. 

Just create a github repo, connect to heroku and deploy. Simple and obvious steps. Once the code is deployed, anyone can talk to the bot because the script refers to the bot on the access token. 

Congratulations! You just made your first telegram bot using node js and deployed it. Ask me on Instagram if you are stuck somewhere or just leave a tweet. 
Instagram - https://instagram.com/digvijaysrathore
Twitter - https://twitter.com/novadigvijay
Know about my telegram bot - https://newstelegraph.netlify.app
Use my bot - https://t.me/NewsTelegraphBot
Developer Relations Interviews feat. Daniel Phiri @malgamves
Tags: career, devrel, beginners
Published: 2020-05-11 09:16:33

Daniel Madalitso Phiri -- [@malgamves on dev.to](https://dev.to/malgamves) -- shares his experiences interviewing for various developer relations roles:

2:12 - applying to dev adv v dev rel
5:01 - applying to his first job even though he felt underqualified
8:21 - what he said when he didn't know the answers
12:41 - #1 lesson learned for remote interviews
13:46 - tips for giving a presentation to interviewers
21:02 - reflections on an interview that went badly
25:25 - asking questions at the end of an interview
28:02 - how to decide NOT to work somewhere
29:44 - check out the cool projects daniel is working on ⬇️⬇️⬇️

{% youtube TzFwdkwLc4w %}

☆ Daniel's Famous StackOverflow Blog Post - https://stackoverflow.blog/2020/03/25/tracking-down-performance-pitfalls-in-vue-js/
☆ Daniel on Twitter - https://twitter.com/malgamves
☆ Daniel on Youtube - https://www.youtube.com/channel/UCphKMcY-9W0w5tp8mBRuYZg
☆ Daniel on LinkedIn - https://www.linkedin.com/in/malgamves/
☆ Developer Conference Zambia - https://www.devcon.co.zm/
☆#RushingFwd - https://beta.polelo.co/frequencies/zzh9zg1P4Ju

CANDIDATE PLANET:
Empowering candidates to ace interviews and negotiate offers. Leave a comment or email Lusen@CandidatePlanet.com with questions you want me to answer.

DANGOORMENDEL:
One-on-one success-based coaching for technical and tech-adjacent candidates applying to tech companies. We specialize in interview preparation and offer negotiation.

SALARY NEGOTIATION PLAYLIST ☆ https://www.youtube.com/playlist?list=PLY0uEDNh-Haqes9eEvyGtzrUWOHv-c1op

SUBSCRIBE:
☆ Youtube ☆ https://youtube.com/c/CandidatePlanet
☆ Newsletter ☆ https://dangoormendel.com/newsletter
☆ LinkedIn ☆ https://linkedin.com/in/lus

MORE INFO:
☆ Website ☆ https://dangoormendel.com
☆ Speaking Inquiries ☆ lusen@candidateplanet.com
☆ Client Inquiries ☆ hello@dangoormendel.com
How To create So It Matters
Tags: machinelearning, kubernetes, erlang, saas
Published: 2020-05-11 09:15:25

I have always been an avid reader. I guess there is something about books that speak to me. The characters leap off the pages, and before I know it, I become so entrenched in the story that I forget that it’s a work of fiction.

Reading sparked my interest in writing. It started with this burning desire to replicate the works of the great authors – Hemmingway, Orwell, and Dickens, just to name a few. But reading has turned into so much more than that; it has opened my eyes to how valuable writing can be as a communication medium.

The truth is we, as a society, write a lot. We really do. Whether you are writing an email to your professors or colleagues or an essay you need to hand in before the deadline, writing is a part of our everyday lives; it’s a natural component of human interaction.
The Front End Podcast - Episode #7
Tags: career, podcast, frontend, css
Published: 2020-05-11 09:01:01

Roll up, roll up, it's time for another exciting episode of [The Front End](https://thefrontendpodcast.site). 

A whole seven episodes in and this time, we're talking with [Ben Furfie](https://twitter.com/frontendben) about his background in games journalism that led into a career in web dev. We're also digging into the state of CSS, specifically Tailwind CSS and how a shift towards utility-driven styling can improve code maintainability and how it compares to methodologies such as BEM.

Listen to episode 7 today on the following channels:

- Apple Podcasts > https://podcasts.apple.com/gb/podcast/the-front-end/id1499349107
- Pocket casts > https://pca.st/osul2zsa
- Spotify > https://open.spotify.com/show/4GuAxptrtY8Es5iHwp09dT
- Anchor > https://anchor.fm/the-front-end

## About episode 7

Ben is a web development manager working for IMI Mobile. He's worked in the middle east as a marketer, and been through the interesting world of games journalism. Today, Ben's talking about the movement towards utility-driven CSS, specifically Tailwind CSS and how it stacks up, how you can use it, and what some of the benefits are.

## Listening direct

Want to listen directly from here?

{% spotify spotify:episode:1qSTJuFJRVVaZPRQuHEizN%}

## Want to be a guest or sponsor the show?

I'm definitely looking for guests to talk about a range of different development topics from careers to origin stories, learning and professional growth, frameworks and more.

Similarly, we're looking for sponsors to fill promotional slots within the show. 

You can find out more here:

- [Being a guest](https://thefrontendpodcast.site/guests)
- [Sponsorship information](https://thefrontendpodcast.site/sponsorship)

Thanks for listening!
What I'm Learning from Pulling Back Instead of Forging Ahead
Tags: devjournal, codenewbie, womenintech
Published: 2020-05-11 08:56:26

_This post was originally published on May 11, 2020 on [my blog](https://alexlsalt.github.io/blog)._

Happy Monday! Weekend was good, despite my constant inner battle of trying to get some quality brain-rest as opposed to just pushing for working on *one more thing*. (A conscious work in progress, mind you!)

Thankfully, I'd say that the restfulness won out overall. For this week, my focus is on actively noticing if I'm starting to feel stressed or overwhelmed and then making the conscious decision to actually pull back instead of pushing myself.

It feels counterintuitive, for sure - to press the brakes when I'm starting to feel the overwhelm of the work I need to do. But the thing is, in the grand scheme of things, I think my brain is viewing the work that could be done over the course of weeks and months as something to be done and neatly wrapped up by the end of the day or week.

And that's bananas!

Our brains aren't actively trying to stress us out, they've just been so conditioned by high-achievers to constantly push for more, more, more (!!!) that if they don't feel constantly in motion, then they feel like something's wrong.

This week is about working on that for me.

Aside from that inner work, I've got a couple goodies on my plate. This week I'll be finishing my client project (web design), so that'll be awesome. I've also got a HackerRank coding assessment to complete by Thursday - so *that* is also top of mind.

In fact, I've made it a goal of mine to spend one hour each day - since Saturday, I think (?) - practicing problem sets on HackerRank to get myself used to the format and all that fun stuff. I'm actually really loving it - for me, it's like solving challenging puzzles and sometimes I just can't get enough. (Hence, the one-hour time limit...)

Okay, this is starting to get long. I'm off to start my week - cheers to all!
Core features overview of JavaScript syntax (ES6)
Tags: javascript
Published: 2020-06-15 14:55:46

---
title: Core features overview of JavaScript syntax (ES6)
published: true
date: 2020-05-11 08:36:37 UTC
tags: JavaScript
canonical_url: https://www.ma-no.org/en/programacion/javascript/core-features-overview-of-javascript-syntax-es6
---

Several changes to JavaScript were introduced by ECMAScript 2015, also well-known as ES6. Here is a summary of a number of the foremost common options and syntactic variations, where applicable, with comparisons to ES5.Variables and constant comparisonIn the following table, we provide a brief overview of the concepts of scope and the differences between let, var, and const.KeywordScopeHoistingCan Be ReassignedCan Be RedeclaredvarFunction scopeYesYesYesletBlock scopeNoYesNoconstBlock scopeNoNoNoVariable declaration"Let" allows us to define variables. Originally we used the keyword "var" to declare our variables. However, when it comes to scope, it has some limitations because it does not offer a block scope. But… !



Read on [📖!](https://www.ma-no.org/en/programacion/javascript/core-features-overview-of-javascript-syntax-es6)
Creating name box with React 
Tags: react
Published: 2020-05-11 08:20:44

Anyone knows why I get a blank white screen when I tested this code? It works in codepen.io

ref: https://www.w3schools.com/REACT/default.asp

note:  I wonder why I cannot paste html code here?  therefore, I use pastebin:

https://pastebin.com/1etYYB2p
Run your own Jupyter Notebook on the Cloud
Tags: jupyter, datascience, cloud, googlecloudplatform
Published: 2020-05-11 07:56:30

*Originally published at [pbhadani.com](https://pbhadani.com/posts/run-your-own-jupyter-notebook/)*

Jupyter Notebook is an open-source web-based application that allows data scientists to build end-to-end Machine Learning pipeline starting from Data exploration, visualization, data transformation, feature extraction, and manage ML model lifecycle.

In this video, I explain the installation process of the Jupyter Notebook on the choice of hardware on the Cloud, particularly the Google Cloud Platform(GCP).

Hope you enjoy the video tutorial.

{% youtube Lk0SmRYtGt8 %}

## Summary
This video explains how to install Jupyter Notebook on Google Cloud Platform(GCP) in less than 10mins.
Below are the steps and commands performed in the video:
##### Step 0 (Optional)
Generate the public/private SSH keypair.
```bash
ssh-keygen -t rsa -b 4096 -C jupyter_demo -f jupyter_demo
```

##### Step 1
Create the Virtual Machine using Google Cloud Console UI, gcloud commands or with automation tools like Terraform.

##### Step 2
Install the software packages.  
```bash
sudo apt-get update
sudo apt install python3-pip
pip3 install jupyter
echo "export PATH=$PATH:~/.local/bin" >> ~/.bashrc
source ~/.bashrc
jupyter notebook --no-browser
```

##### Step 3
Access the Jupyter Notebook.
Run the following command to create the SSH tunnel.
```bash
ssh -i private_key -N -f -L 8888:localhost:8888 username@your_remote_host_name
```

Once the tunnel is setup, open the browser, go to `localhost:8888` and provide the token generated in **Step 2**.  
Congratulations!!! Jupyter Notebook is now accessible from the local workstation.
<br>

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


<br>
Please subscribe to the [YouTube](https://www.youtube.com/channel/UCR8RtRbr87S86UJakb7D0Pw) channel for the updates.  

If you have feedback or questions, please reach out to me on [LinkedIn](https://linkedin.com/in/pradeepbhadani) or [Twitter](https://twitter.com/bhadanipradeep)
#PureCSS - Responsive 3D Ball
Tags: codepen, purecss, css
Published: 2020-05-11 07:42:03

---
title: #PureCSS - Responsive 3D Ball
published: true
tags: codepen, purecss, css
---

<p>Responsive 3D Ball using CSS</p>

{% codepen https://codepen.io/AsyrafHussin/pen/dyYeBgv %}
Xpose [Beta Version] - No more F12
Tags: webscraping, webcrawler, firefox, dotnetexpose
Published: 2020-05-11 07:39:42

Hi guys!
I've developed a dotnet lib called [DotNetExpose](https://github.com/joao2391/DotNetExpose).
The main goal of it is to show the same information when you press F12 (browser dev tools).
So, now I took its functionalities to a browser extension. For now it's available only on [FireFox](https://addons.mozilla.org/pt-BR/firefox/addon/xpose/?src=search).

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

I hope you enjoy it!

Feel free to follow me on [Github](https://github.com/joao2391/) and [LinkedIn](https://www.linkedin.com/in/joaopaulodecastrolima/)
LeetCode: Find the Town Judge
Tags: leetcode, datastructures, algorithms, hashing
Published: 2020-05-11 07:29:21

---
title: LeetCode: Find the Town Judge
published: true
description: 10.05.2020
tags: leetcode, datastructures, algorithms, hashing
series: LeetCode May Challenge
---

### Problem Statement

In a town, there are `N` people labelled from `1` to `N`. There is a rumor that one of these people is secretly the town judge.

If the town judge exists, then:

1. The town judge trusts nobody.
2. Everybody (except for the town judge) trusts the town judge.
3. There is exactly one person that satisfies properties 1 and 2.

You are given `trust`, an array of pairs `trust[i] = [a, b]` representing that the person labelled `a` trusts the person labelled `b`.

If the town judge exists and can be identified, return the label of the town judge. Otherwise, return `-1`.

 

**Example 1:**

```
Input: N = 2, trust = [[1,2]]
Output: 2
```

**Example 2:**

```
Input: N = 3, trust = [[1,3],[2,3]]
Output: 3
```

**Example 3:**

```
Input: N = 3, trust = [[1,3],[2,3],[3,1]]
Output: -1
```

**Example 4:**

```
Input: N = 3, trust = [[1,2],[2,3]]
Output: -1
```

**Example 5:**

```
Input: N = 4, trust = [[1,3],[1,4],[2,3],[2,4],[4,3]]
Output: 3
```

 

**Note:**

1. `1 <= N <= 1000`
2. `trust.length <= 10000`
3. `trust[i]` are all different
4. `trust[i][0] != trust[i][1]`
5. `1 <= trust[i][0], trust[i][1] <= N`

### Solution

```c++
class Solution {
public:
    int findJudge(int N, vector<vector<int>>& trust) {
        unordered_map<int,int>trustedBy, trusted;
        
        int judge = -1;
        for(int i=1;i<=N;i++)
        {
            trustedBy[i]=0;
            trusted[i]=0;
        }
        for(int i=0;i<trust.size();i++)
        {
            trustedBy[trust[i][1]]++;
            trusted[trust[i][0]]++;
        }
        for(int i=1;i<=N;i++)
        {
            if(trustedBy[i] == N-1 && trusted[i] == 0)
            {
                judge = i;
                break;
            }
        }
        return judge;
    }
};
```

### Solution Thought Process

- First we declare two `unordered_maps` - `trustedBy` and `trusted`
- If a trusts b, then `trustedBy[b] = 1`  because b is trusted by a, and `trusted[a] = 1` because a trusted b. For each entry in `trust` we populate `trustedBy` and `trusted`.
- Then for every people, we see if their `trustedBy` is `N-1` and their `trusted` is 0, meaning that they have been trusted by all and they didn't trust anyone. If we found anyone like this, we break the loop and set the people as our judge.

### Complexity

**Time Complexity:** O(n).

**Space Complexity:** O(n).
Filter Unique Values From Array Using JavaScript
Tags: beginners, javascript, 100daysofcode, codenewbie
Published: 2020-05-11 07:28:28

The <mark>Set</mark> object type was introduced in ES6 (or ES2015), and along with the spread operator <mark>...</mark>, you can use it to create a new array with only the unique values.

```javascript
const array = [1, 1, 2, 3, 5, 5, 1]
const uniqueArray = [...new Set(array)]];

console.log(uniqueArray);
// Output is [1, 2, 3, 5] 
```
Before ES6, isolating unique values would involve a lot more code than that.

This trick works for an array containing primitive types: ***undefined, null, boolean, string,*** and ***number***. If you had an array containing objects, functions or additional arrays, or you'd need a different approach.
16 of the UAE’s best-known universities for admission in 2020
Tags: universities, admissions2020, sanjeevnanda, UAE
Published: 2020-05-11 07:28:18


<h2>Ajman University</h2>

Established in 1988 as the first private university in the GCC, Ajman University (AU) was also the first university in the UAE to admit expatriate students. The 2020 QS World University Rankings lists AU among the top 800 universities globally and in the top 45 in the Arab region. AU is one of the first six higher education institutions in the world to receive global accreditation from the UK’s Quality Assurance Agency (QAA).

Courses

AU’s top five programmes are BSc in Civil Engineering, BSc in Mechanical Engineering, Doctorate of Business Administration (DBA); Master of Public Relations and Corporate Communication and MSc in Endodontics.

Last date of application Admissions are open until August 31


<h2>Al Ghurair University (AGU)</h2>


AGU is one of the first private academic institutions licensed by the UAE Ministry of Education. Its courses are meticulously designed to cover the latest industry trends and equip students with the knowledge and experience to excel in jobs.

E-learning infrastructure

The Al Ghurair University is running its LMS– Blackboard Learn/SaaS Ultra – on Oracle servers to facilitate distance learning.


Online admission

The documents required for online application are copies of grade 12 results/ pre-board exams / 1st term/ 2nd term (whichever is available); degree certificate with transcripts; the result of English Language proficiency test (if available); passport copy; visa page; Emirates ID

Courses

It offers a range of undergraduate and postgraduate programmes in various disciplines. Undergraduate Programmes: Bachelor of Arts in Interior design, Bachelor of Architecture, Bachelor of Business Administration, BSc in Computer Information Systems, BScin Computer Science and Engineering, BSc in Electric and Electronics Engineering, Bachelor of Arts in Public Relations and Bachelor of Law

Postgraduate Programmes: Master of Business Administration, Master of Private Law, Master of Public Law, Professional Diploma in Teaching

Last date of application September 2020

Virtual campus tour Available

Source: https://gulfnews.com/uae/education/16-of-the-uaes-best-known-universities-for-admission-in-2020-1.1587977203896
The Benefit of Same Origin Policy
Tags: beginners, security
Published: 2020-05-11 07:23:58

In this world we know that there's at least two kinds of people, a good and a bad. If someone is good then you can trust them and know that they are not out to get you. On the other side of the spectrum -the bad- they are always up to something mischievous. This can also be said about websites! 

We all use some sort of social media, or banking website that contains some sort of private information that we don't want shared. Malicious websites that you might accidentally stumble upon might want access to certain information that is stored on these other sites. For example you might be on FaceBook and see an advertisement that says "Win a free Ipad pro" simply by clicking on the link below! Then you're on the site and start wondering where is my free Ipad? All the while this site is trying to run some Javascript code or Ajax request trying to get access to your friend list! We definitely don't want that to happen and this is where the Same origin policy comes into play.

The Same origin policy or SOP is able to add a layer of security by letting websites share data only if they have the same origin. What am I talking about when I say origin? For that we have to take a look at the url! A url is broken down into scheme, host/domain name, and a port.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wv9gdta4186ofsqhvsrm.png)

When any request is trying to be made by a webpage, that webpage url becomes the origin. Going back to our example from above. Now that we are on this new malicious website. When the website tries to run the request to get our friend list information from Faceboook. The Same origin policy steps in and says, "hold up, wait a minute! Your scheme, domain, and port don't match.".
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/akw7su8f1aqqrd6mfese.png)
The request from the malicious website gets denied, keeping our friend list information safe.

This policy is just one of many ways that the information that we keep in certain sites are safe from any outside forces.
Stop importing Multiple Fonts and Start using Variable Fonts
Tags: css, html, beginners, webdev
Published: 2020-05-11 07:19:31

***Variable Fonts.***

*Maybe you already know all about them.*

*Maybe you have no clue what they are.*

*In this short article, I’ll take you through how you can use variable fonts to your advantage in creating efficient & fun websites.*

[Link to article](https://www.thatsanegg.com/blog/stop-importing-multiple-fonts-and-start-using-variable-fonts/)