teleren/devto huggingface dataset:
Career Pixel - Tips for junior developers
Published: 2020-01-23 14:30:33

Here are a few tips I wish I was told when I started my career as a developer 8+ years ago:

## 1 - It’s okay not to know

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/buwbahyn2466xg9ws05v.png)

As a beginner developer on the first job, the biggest fear I had was: “what if I don’t know something?”. Took me a few years to realize that, if you are in a good work environment, it’s okay not to know something.

A big part of working as a developer is to learn something new every day. A good company should allow you to do just that. Of course, there will be stuff that you already know, and there will also be stuff you have no idea about and that’s okay. Don’t be afraid to ask your friends and co-workers as well, they may be able to help!

## 2 - Code reviews are good

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/8216p4zm4i4ju13ku4ix.png)

Good code reviews can help you improve your code over time and should be your friend. At the beginning of my career, I use to take any criticism about my code personally, but over time I realized that they are actually a great tool to keep learning, improving and do great work!

## 3 - Keep it simple

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/gq326n00zgvdj4dkudrk.png)

This one is a big one. So many times I tried to imagine the perfect solution, super scalable, that has every feature my users could possibly want. Turns out: 

- you cannot know what your users want until they actually use it, 
- you will come back to your code to scalability or performance later, 
- good code is code that works
- you’re only human

## 4 - Don’t doubt your worth

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/fnu5oq2ypyjag1hmossf.png)

«Imposter Syndrome» is a very common thing in our industry, particularly for beginners, but seasoned developers too. We all experience it differently though, but I would say: if it motivates you to learn more and practice more, that’s great. If not, try to build your confidence, mentor others, etc… I will have another Pixel about confidence later.

---

You can also find these pixels on my Instagram: https://instagram.com/valentinprgnd. I will publish Pixels every Monday, Wednesday, and Friday about career development in tech, code, mental health and health for developers. Follow me for more tips @valentinprngd and check out my podcast https://rebased.whatdafox.com.
Syntax Highlighting with Prismjs and React
Tags: javascript, react, tutorial
Published: 2020-01-23 14:27:44

In this blog post, I will explain a really easy way to add syntax highlighting in your page where you want to show code the same https://reactjs.org or any site which shows code with syntax highlighting.

We will use https://prismjs.com/ library for highlighting syntax.

Let's start by creating our react component to show code.


```javascript
import React, { useEffect } from "react";

export default function Code({ code, language }) {
  return (
    <div className="Code">
      <pre>
        <code>{code}</code>
      </pre>
    </div>
  );
}

```

This component will display your code but without any syntax highlighting.

Now let's add prismjs using npm or yarn.

`npm install --save prismjs`

or

`yarn add prismjs`

Now we can use this in our component


```javascript
import React, { useEffect } from "react";
import Prism from "prismjs";
import "prismjs/themes/prism-tomorrow.css";
import "./styles.css";

export default function Code({ code, language }) {
  useEffect(() => {
    Prism.highlightAll();
  }, []);
  return (
    <div className="Code">
      <pre>
        <code className={`language-${language}`}>{code}</code>
      </pre>
    </div>
  );
}
```

Now just pass any code and language to this component and boom we have added syntax highlighting in any react app!!

There are also different themes available in prismjs which can be used by just importing different CSS file.

In this example I have used tomorrow-night theme, you can use any theme.

Codesandbox demo: https://codesandbox.io/s/syntax-highlighting-with-prismjs-36ud2

Follow my blog: https://amitchauhan.tech
Tips for speaking to college students about DevRel
Tags: devrel, career, students
Published: 2020-01-23 14:17:52

---
title: Tips for speaking to college students about DevRel
published: true
description: I talked about DevRel to final year students at University and this is what happened.
tags: devrel,career,students
cover_image: https://thepracticaldev.s3.amazonaws.com/i/a0r611i9k7ai3v2td4p2.jpg
---

I was invited to deliver a 30 minutes talk to last-year-students at a University on Wednesday this week. The talk was held on "Career Opportunities Day" so, considering the amount of consulting firms present at the event, I decided to talk about something totally different and new for most students: DevRel as professional career.

Around 25 students showed up to attend the talk. Unfortunately my talk was scheduled right before the end of the agenda so many people had left already. 

> Tip #1: talking about "exotic" topics at these kinds of events can be challenging, so try to schedule your talk early in the morning when your audience is fresh.

As you can imagine, I started the presentation with the obvious question: *"Does anyone know what is DevRel about?"*. Nobody answered but that was kind of expected, right? :-)

The content of the talk pretty much covered the usual DevRel 101 stuff: what DevRel is and is not, how we help developers to succeed, the beauty of working with communities or why DevRel is important for companies. I gave an example of *“A Day in the Life of a Developer Advocate at a Hackathon representing [Amadeus for Developers](https://developers.amadeus.com)"*, which they liked very much.

> Tip #2: Next time I deliver this presentation to a similar audience, I will base the whole presentation on examples and personal stories, as they seem to work better.

Okay, time for some metrics and personal observations:

- All of them were surprised to see a professional career option related to software development that didn't imply a full-time coding position.
- Only 2 students raised their hands to the question *"Has anyone ever contributed to an Open Source project?"*
- Almost everyone raised their hands to the question *"Do you have a public code repository (GitHub, GitLab...)?"*
- No one had participated in a Hackathon before.
- They loved the idea of traveling to attend events.
- I saw some *"No thanks"* faces when I talked about public speaking skills.
- I realized that 20% of the students were taking notes. The other 80% just listened.

> Tip #3: There is an interesting opportunity in proposing internal Hackathons at universities.

As usual, I have the feeling that I forgot many ideas and examples, but all in all, I'm happy with the results.

The slides I used as reference during the talk can be found on my [speakerdeck](https://speakerdeck.com/alnacle/devrel-as-professional-career). 

Looking forward to the next talk!
Daily Challenge #169 - Christmas Tree
Tags: challenge
Published: 2020-01-23 14:16:45

---
title: Daily Challenge #169 - Christmas Tree
published: true
series: Daily Challenge
description: Create a function christmasTree(height) or christmas_tree(height) (in Ruby) that returns a christmas tree of the correct height
tags: challenge
---
Create a function `christmasTree(height)` or `christmas_tree(height)` (in Ruby) that returns a Christmas tree of the correct height

`christmasTree(5)` || `christmas_tree(height)` should return:

 ![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/3mpbq3qlrszf3wjcdvyv.png)

Height passed is always an integer between 0 and 100.

Use \n for newlines between each line.

Pad with spaces so each line is the same length. The last line having only stars, no spaces.


***
_This [challenge](https://www.codewars.com/kata/52755006cc238fcae70000ed) comes from user8062788 on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
How dependent are you on your development environment configuration?
Tags: watercooler, productivity
Published: 2020-01-23 13:59:01

How much would it slow you down if you were required to get work done on a clean install of your OS, assuming you have your compilers/interpreters available, using a plain, unconfigured text editor and an uncustomized shell?  Would your first step *have* to be setting things up to your preferences or could you sit down accomplish a moderately complex task in a reasonable time without it?

No more squiggly lines...

*[cover image](https://en.wikipedia.org/wiki/File:Windows_Notepad.png) of Windows Notepad [used with permission](https://www.microsoft.com/en-us/legal/intellectualproperty/Permissions/default.aspx) from Microsoft*
Payment Tokenization Terminology
Tags: payment, terminology
Published: 2020-01-23 13:58:11

I had a lot of trouble with new terminologies when I took part in Samsung Pay. Someone may be in the same situation somewhere. I will introduce very basic words here.
#### Tokenization: It's not about bus token.
* replaces a real card an account number; a virtual one-time card?
* is bound to a single merchant(shop)
* need a ID&V of cardholder to create it

#### Token Components
* 15-19 digits + expiration date
* cryptogram that is unique to each transaction

#### PAN (Primary Account Number)
* 13-15 digits representing a card account number
* A single PAN may be associated with multiple tokens

#### Card Issuers
* are banks who issue credit cards
* give cardholders(card users) credit for spending
* send merchants payments for purchases

#### Major issuers
* Amex, Discover: issuer and payment network at the same time
* BoA, Capital One, Citi, Wells Fargo, Barclay, and so on

#### Major Card Networks
* Visa, Mastercard, Amex, Discover, and so forth
Recent Interview Experience
Tags: laravel, git, php, oop
Published: 2020-01-23 06:02:55

I'm sharing my recent interview experience for the job description:

1. Strong understanding of Object Oriented Programming
2. Solid development experience in PHP, Laravel, Rest API, GIT
3. Strong troubleshooting skills and Good experience of using source control systems.: TFS, GIT
4. A natural communicator who can explain technical concepts in clear, plain English (both written and verbal)
5. Should be able to explain at least one of his/her development assignments with reasoning; as to how it was designed, what approach were used and why?

So, here is how it went

explain me in brief about this xyz project you did
what's a persist cookie
how a php session works and why we use it?
suppose if we disable cookies in our browser, are we able to login?
explain the entire process of session implementation in your php project
Did you implement caching in your laravel project, how it works
What are facades
what's an abstract class
Difference between abstract class and interface
why do we use interface
Can you explain me the request lifecycle in laravel
what's polymorphism
explain method overloading and overriding with an example and their differences
what's ajax and explain synchronous and asynchronous requests
can we send a synchronous request in ajax
what's indexing in SQL
how indexing affects the select, insert and update queries
what's git stashing and how it works?
can we use multiple env files in a laravel project?
how does queue works in laravel and how do we implement it on server

To conclude, when you work full time on frameworks like Laravel. Your base skills kind of fades off like manually managing a session since laravel does a lot of scaffolding for you, so you almost forget about these things as they are not automatically being taken care of. However, we have to keep in mind about internal workings to such concepts.

For the cure, I might create one project using vanilla PHP. As it will brush up those concepts.

Hope, these short snippets would be helpful to you folks. Bye for now :)
Test your JavaScript level with a (fun) speed coding challenge at Toptal
Tags: toptal, javascript
Published: 2020-01-23 13:30:06

A friend of mine got quite excited and spent half a night reverse-engineering the challenge to dominate the leaderboard when we tested the challenge before launching online.

Now, the online [JavaScript Speed Coding Challenge](https://speedcoding.toptal.com/start/Qvtq7a) is live officially, and everyone can compete.

The deal is that top competitors can take a fast track through the Toptal recruiting process. But there are more prizes:

- Apple Airpods (1st place)
- $100 Amazon gift card (1st-5th)
- Toptal t-shirt (1st Place - 20th Place)

The challenge consists of multiple micro-tasks that you solve while the 3 minutes timer is ticking. It starts with simple tasks like doubling a number:

```javascript
box.double = function double (x) {
    //return x doubled
    
    
};
```

But as you solve them, the complexity of tasks increases (as do the points you gain per task):

```javascript
box.swapHalves= function swapHalves(x) {
    //x is a string. Cut x in half and move the second half to the beginning
    //'1234' will become '3412', '12345' will become '34512'
    
    
};
```

The Leaderboard looks very competitive already - I cannot get into the top 5 even though I'm the developer behind the challenge:

![Leaderboard](https://thepracticaldev.s3.amazonaws.com/i/874wfsjkro7hvf1udu87.png)

 
But here comes the fun part! There are **no limits to your creativity** in terms of how you decide to complete the challenge. This competition is not just about knowing JavaScript and coding fastly. It is also about how creative you can get to get into the top 5 ;)

I am personally very excited to see the app I coded going live at scale, and I hope to get the feedback of the dev.to community:

- how can the challenge be improved to make it more fun?
- are there any issues that I didn't catch before it went live?
- do you have an idea for a new coding question?


### Applications Outside IT Field?

What I've been also thinking about is whether there is any potential for using the same "challenge" approach to attract talent in fields other than IT?

For example, writers can compete in knowing grammar. Travel agent candidates may have their relevant questions tested as well with questions like "What is the tallest building in the world", "What is the Australia's national flower", etc. Real estate agents can compete in understanding the local law, auction rules, etc. Do these examples make sense?

This is my very first post here at dev.to, and I can't wait to get engaged in discussions with the community!

<small>
Disclaimers:
One. I'm the developer behind the challenge.
Two. The link used in the article is my referral link. When [signing up with Toptal later here](https://www.toptal.com/talent/apply#trust-nothing-but-your-top-programmers), use the same email you used in the challenge, and we both can get a bonus when you get your first job at Toptal.
Three. In this article, I do not represent the Toptal team.
</small>
I am an engineering manager now
Tags: management, engineeringmanager
Published: 2020-01-25 16:52:52

---
title: I am an engineering manager now
published: true
date: 2020-01-23 13:29:08 UTC
tags: management, engineeringmanager
canonical_url: https://www.kahlillechelt.com/2020/01/23/i-am-an-engineering-manager-now/
---

Last year my manager quit. I was offered his position and since December or so, I am an engineering manager.

It is strange to move from a well-defined role into such a hazily-defined one.

A few things have changed. I don’t code anymore at work and the relationship to my team has changed. Especially to those who now report to me.

I want to be the best possible manager to them that I can be, so I am busy learning.

My friend [Henning Glatter-Götz](http://twitter.com/hglattergotz) recommended the [**Managing Up podcast**](http://managingup.simplecast.com/) to me. I have listened to a bunch of episodes so far and it has been very helpful already.

If you are an engineering manager or are interested in becoming one, I highly recommend you check out [Managing Up](http://managingup.simplecast.com/).

So far, my favorite episodes are:

[**Episode 5: One on Ones: The Basics**](https://managingup.simplecast.com/episodes/54705bed)

I loved hearing about how they approach their one-on-ones and about their different techniques on how to ask questions. It was also really great to learn how commonplace one-on-ones are in engineering organizations.One thing that surprised me was that it seems to be common to have weekly one-on-one meetings. We do it bi-weekly at LogMeIn. I think that it’s a good frequency if the one-on-ones are not skipped.

[**Episode 26: Creating Self-Managing Teams**](https://managingup.simplecast.com/episodes/creating-self-managing-teams)

This episode really exposed the experience the co-hosts of the show have. They are very open about mistakes they have made in the past and discuss how you might achieve “managing yourself out of a job”. This is a phrase that I have been thinking about a lot myself and I feel that should definitely be an engineering managers goal.
Too direct introduction to MySQL GTID
Tags: mysql, replication
Published: 2020-01-23 13:22:09

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/67e25my19i7xz104yor5.png)
GTID is better than old filename and fileoffset to manage replication explicitly. MySQL and MariaDB have different formats of GTID. Here shows the GTID of MySQL.
Every time the master makes an update it creates an GTID event to the binlog and next do the actual transaction. A slave sends the master a range of GTID that has been executed (GTID_EXECUTED) and the master thread sends back the slave all the unexecuted transactions. The IO thread of the slave saves the transactions in the relay log and the SQL thread applies the master trasactions on the slave.


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/xchjcor5vwfk6quhtof9.png)
The slave increases GTID_NEXT by 1 when it executes a transaction normally. However in some cases, we want to modify the value manually. A typical case is to skip a master transaction in the slave. To do that, we assign the GTID_NEXT session variable the failed transaction number and inject an empty transaction like the above picture. By doing this, GTID_EXECUTED of the slave jumps to a wanted number.
Angular Security Checklist
Tags: angular, security, javascript
Published: 2020-01-23 13:15:37

---
title: Angular Security Checklist
published: true
tags: #angular #security #javascript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/fli9khwucjdw9em5y9f6.png
---
While developing Angular applications we need to pay strong attention to security aspects to prevent, simply speaking from being hacked!

There are many ways we may put our application users in danger and they might be victims of attacks like **Cross-site scripting** (XSS) or **Cross-site request forgery** (CSRF). Here is a list of the essential checks you have to perform to raise the level of security of your applications.

👉 Use **HttpOnly** and **Secure** cookies,
👉 **Sign** the cookies and tokens (like JWT) with **a strong secret**,
👉 **Do not** store sensitive data in JWT payload,
👉 Ensure your JWT library does not accept **alg: none**,
👉 Transport all data over **HTTPS**,
👉 Use **Content Security Policy** ver. 2,
👉 Do not allow inline scripts (no **unsafe-inline**),
👉 Use **integrity** property of all external scripts,
👉 Avoid Angular's **bypassSecurityTrust*()** methods,
👉 Use CSRF protection with **CSRF-Token**,
👉 Avoid custom auth library implementation,
👉 Check all **API endpoints** for role-based authorization,
👉 Use **AoT compilation** for template checks.

Here you can get a free printable checklist:
⚡ [Angular Security Checklist PDF](https://mailchi.mp/b2dae45388cf/angular-security-checklist) ⚡

Let me know in the comments if you are aware of all the checks and I will be creating more content covering these aspects!
Picky Picky with forEach()
Tags: javascript, es6, vannillajs, beginners
Published: 2020-01-23 13:03:54

This article is meant to introduce you to some of the powerful capabilities of the "mighty for loop" alternatives in JavaScript(JS from now).

If you're new to the JS programming language, click here to have a quick read on its history: http://bit.ly/36cSCHO

For the purpose of simplicity, I will be using the ES6 syntax to show how JavaScript code works. More to read about ES6 here: http://bit.ly/JS_ES6

The famous for loop function has been in existence since the introduction of programming languages, but in this case, we will focus on JavaScript. The forLoop function is used to traverse through an array of items or objects and then do "something" after that

Below is how the forLoop function works.

```javascript
const arr = [1, 5, 6, 3, 2]

for(i=0; i< arr.length; i++){
    console.log(arr[i])
} // results: 1, 5, 6, 3, 2
```

We are simply going through the whole array using 'i' and making sure that we are within the given array's length and printing the items one-by-one.

Now this may look cumbersome to some people who would need something simple & straightforward. Here comes in the "forEach()" function. Below is how the same code above would be implemented.

```javascript
const arr = [1, 5, 6, 3, 2];

arr.forEach(i => {
            console.log(i)
        })
//result: 1, 5, 6, 3, 2
```

And voila! You just made use of the forEach() function without having to state the limit or have to use the "i++" to show iteration.

Be sure to check in soon for another article of the "forLoop alternatives" series.
Daily Developer Jokes - Thursday, Jan 23, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-01-23 13:00:06

---
title: "Daily Developer Jokes - Thursday, Jan 23, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Thursday%2C%20Jan%2023%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258d992c4e.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ How do programming pirates pass method parameters?

___A:___ Varrrrarrrgs.
 -->
How to map theses data to a select box in angular 8
Tags: help, angular
Published: 2020-01-23 12:56:18

This is a hash map response from backend and i need to display theses dates in a select box?how can i achieve it ?
{ 
   "map":{ 
      "2019-12-27T18:30:00.000+0000":[ 
         "11:00-11:15"
      ],
      "2019-12-29T18:30:00.000+0000":[ 
         "10:00-10:15"
      ],
      "2019-12-26T18:30:00.000+0000":[ 
         "10:00-10:15",
         "10:15-10:30",
         "11:00-11:15",
         "11:15-11:30",
         "10:00-10:15",
         "12:00-12:15"
      ]
   }
}