teleren/devto huggingface dataset:
What’s your excuse for bad code?
Tags: discuss, career, productivity
Published: 2019-05-28 18:18:22

---
title: What’s your excuse for bad code?
published: true
description: 
tags: discuss, career, productivity
cover_image: https://thepracticaldev.s3.amazonaws.com/i/woerastkrrxdns7i01s2.jpeg
---
Often I hear developers trying to find an excuse for their bad code. Most of the time it end up as: lack of time, bad management, a colleague who left the company, etc.
What's the reason you heard the most?
I used to train myself to avoid excuses and take responsibility. But I also can’t resist sometimes to blame external factors 😢
"Hi - I'm new here!" 
Tags: firstpost
Published: 2019-05-28 17:00:23

Hello everyone, I am Naresh Joshi and this is my first post on dev.to, thanks in advance for checking it out!

I recently found dev.to community and I am impressed by the articles and discussions developers can have here.

I am a Software Developer, working mostly on Java programming and its related frameworks like Spring, JPA, Hibernate.

Currently, I am working Scala and Spark and I like it.

I love to create my own thoughts about anything which comes to my notice and I think we should always have our own thinking on everything rather than just following what others think.

I publish my thoughts on my blog ProgrammingMitra(programmingmitra.com) and I would love to contribute to dev.to!

I am looking forward to engaging in this community and talk to you all!
Adding users to the sudo group
Tags: shell, bash, informatics, linux
Published: 2019-07-09 06:09:10

---
title: Adding users to the sudo group
published: true
tags: shell,bash,informatics,linux
cover_image: https://thepracticaldev.s3.amazonaws.com/i/4u43iss1lxbbgc85f47h.jpg
canonical_url: 
---

One of the most important things to do after setting up a new Linux server (or after taking over an existing one) is to create a new user, possibly with _sudo powers_. [Sudo](https://en.wikipedia.org/wiki/Sudo) is a special Linux command that allows users to perform administrator tasks even if they are not system admins.

The main reason for having a sudo user (or _sudoer_) is because logging in as root is usually not desirable, since it can cause troubles more often than not, but we may still want to be able to perform administrator tasks with a non-root user. Moreover, adding one or more users to the sudo group can avoid the need of spreading root credentials, because a sudo command will require the user’s own password, not the root’s one.

All the members of the sudo group and their restrictions and permissions are in the `/etc/sudoers` configuration file. Explaining this file and in general the sudo usage is quite an extensive topic, so we will only cover the case where we want to create a new user (or we already have it) and add it to the sudoers.

## Creating a new user

_If you already have a fully functioning non-root user and you just want to give it sudo privileges, you can skip to the next section._

First of all, we may want to create a new user, that we will later add to the sudoers. In order to do this, we can use the following command in the terminal:

```bash
adduser <username>
```

A new user called `<username>` will be created, together with his own home folder, usually located in `/home/<username>/`. This new user will of course require a password, that we will need to type twice; the password will not be visible for security reasons.

The command will also prompt us for some basic information about the new user, such as name, telephone number, etc. It is possible to leave this fields blank, though it is recommended to at least fill in the name field.

## Adding a user to the sudo group

It is possible to add a user to the sudo group without having to mess around with the `/etc/sudoers` file. This can be accomplished using the following command:

```bash
usermod -aG sudo <username>
```

This command will add the user `<username>` to the sudo group, and that’s it.

From now on, the `<username>` user will be able to access administrator privileges just by prepending sudo to any command, and providing his own password.
What do you think about Frozonic?
Tags: showdev, devtools, share, discuss
Published: 2019-05-28 16:35:11

---
title: What do you think about Frozonic?
published: true
description: Share your thoughts about Frozonic
tags: showdev,devtools,share,discuss
---


# What do you think about Frozonic?

Hey all!

We launched our beta a few weeks ago and would love to hear what you think about the app.

Since we launched we've made a bunch of updates to make sure everything is super straightforward.

It would mean a world to us if you could take a few minutes to try it out and let us know what you think. You can visit [here](https://www.frozonic.app) and sign up via Github. It is pretty easy.

Thanks to all in advance!
Roadmap to Web Developer in 2019
Tags: webdev, beginners, react, javascript
Published: 2019-05-28 16:31:22

---
title: Roadmap to Web Developer in 2019
published: true
description: Roadmap to Web Developer in 2019
tags: webdev, beginners, react, javascript
---

Roadmap to Web Developer in 2019

The purpose of these roadmaps is to give you an idea about the landscape and to guide you if you are confused about what to learn next and not to encourage you to pick what is hip and trendy. You should grow some understanding of why one tool would better be suited for [rooms in kanpur](https://www.mrroom.in) cases than the other and remember hip and trendy never means best suited for the job

![roadmap](https://raw.githubusercontent.com/kamranahmedse/developer-roadmap/master/images/intro.png)

**FRONT-END Roadmap**

![front](https://github.com/kamranahmedse/developer-roadmap/raw/master/images/frontend.png?fix=531)

**BACK-END Roadmap**

![back](https://github.com/kamranahmedse/developer-roadmap/raw/master/images/backend.png)

**Dev-Ops Roadmap**

![devops](https://raw.githubusercontent.com/kamranahmedse/developer-roadmap/master/images/devops.png)

This post is incomplete without mentioning the person who has created this open-source project. [Developer Roadmap](https://github.com/kamranahmedse/developer-roadmap)


**Share this. Happy Developing Pal.!**
[Follow my blog](http://www.realabbas.com)
Discuss - UX/UI Design Considerations and Challenges for the Elderly
Tags: discuss, ux, ui, webdev
Published: 2019-05-28 16:28:25

---
title: Discuss - UX/UI Design Considerations and Challenges for the Elderly
published: true
description: Discussing the challenges of designing UX/UI for the elders
tags: #discuss #ux #ui #webdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/0b1p7hhtcjv2vd6qb7v3.jpg
---

When was the last time you sat down with your (grand)parents and tried to help them learn how to use a new app? Everyone who’s been there can recognize the fascinating (and frustrating) experience in which an elderly user enters this new technological world, and requires explanations for things we deem self-explanatory.

When it comes to using mobile devices, senior people may have technology anxiety. They may also face some challenges due to vision problems, complex user interface, lack of support system etc.

I've recently had an idea for a side project which would target senior citizens, elderly people and not so tech savvy individuals. I've been studying and planning for it for a while and I would like to ask you to please share your knowledge, experience and challenges regarding crafting the UX and UI for this audience.

I would very much appreciate it if you could also reference me to an already-implemented web/mobile application or a design system with the main focus on elders to get a better understanding. 

Thanks
What should I learn next?
Tags: discuss, help
Published: 2019-05-28 16:14:46

---
title: What should I learn next?
published: true
description: I need help and guidance from our great community on what should i learn next?
tags: discussion, help
---

Hello to all__.

Thanks to `dev.to` for providing such a nice platform and to the great community that we have.

From past 3 years, i am working on React. Recently I wrote some of articles too.

This one is more about the help I want from our community friends, that what should i pick next to learn except React? What are the suggestions, options i have?

Please help/guide me with this.

Thank you in advance.

Happy learning!
Phred quality score
Tags: python, analysis, bioinformatics
Published: 2019-07-07 09:00:13

---
title: Phred quality score
published: true
tags: python,analysis,bioinformatics
cover_image: https://thepracticaldev.s3.amazonaws.com/i/a1gsrqm6bblwwddzpcgt.png
canonical_url: 
---

Next Generation Sequencing techniques have brought new insights into -omics data analysis, mostly thanks to their reliability in detecting biological variants. This reliability is usually measured using a value called [Phred quality score](https://en.wikipedia.org/wiki/Phred_quality_score) (or Q score).

The Phred score of a base is an integer value that represents the estimated probability of an error in base calling. Mathematically, a Q score is logarithmically related to the base-calling error probabilities P, and can be calculated using the following formula:

> Q = -10 log10 P

In the real world, a quality score of 20 means that there is a possibility in 100 that the base in incorrect; a quality score of 40 means the chances that the base is called incorrectly is 1 in 10000.

The Phred score is also inversely related to the base call accuracy, thus a higher Q score means a more reliable base call. Here is a useful table which shows this simple relationship:  

Phred Quality Score | Incorrect base call prob | Base call accuracy 
--- | --- | --- 
10 | 1 in 10 | 90% 
20 | 1 in 100 | 99% 
30 | 1 in 1000 | 99.9% 
40 | 1 in 10000 | 99.99% 

In [fastq](https://dev.to/robertopreste/counting-sequences-in-fasta-fastq-files-6oo) files, Phred quality scores are usually represented using [ASCII characters](https://en.wikipedia.org/wiki/ASCII), such that the quality score of each base can be specified using a single character. While older Illumina data used to apply the ASCII_BASE 64, nowadays the ASCII_BASE 33 table has been universally adopted for NGS data:

| Q Score  | ASCII char | Q Score  | ASCII char | Q Score  | ASCII char | Q Score  | ASCII char |
| -------- | ---------- | -------- | ---------- | -------- | ---------- | -------- | ---------- |
| 0 | ! | 11 | , | 22 | 7 | 32 | A |
| 1 | " | 12 | - | 23 | 8 | 33 | B |
| 2 | # | 13 | . | 24 | 9 | 34 | C |
| 3 | $ | 14 | / | 25 | : | 35 | D |
| 4 | % | 15 | 0 | 26 | ; | 36 | E |
| 5 | & | 16 | 1 | 27 | < | 37 | F |
| 6 | ' | 17 | 2 | 28 | = | 38 | G |
| 7 | ( | 18 | 3 | 29 | > | 39 | H |
| 8 | ) | 19 | 4 | 30 | ? | 40 | I |
| 9 | * | 20 | 5 | 31 | @ | 41 | J |
| 10 | + | 21 | 6 |||||

Even though there are lots of Python, [Biopython](https://biopython.org) and stand-alone softwares for dealing with Phred quality scores, a simple command to convert an ASCII character to its correspondent quality score is the following (from the terminal):

```bash
python3 -c 'print(ord("<ASCII>")-33)'
```

Or, when working in a Python3 session:

```python
print(ord("<ASCII>")-33)
```

In both cases, just replace `<ASCII>` with the actual ASCII character and that will do the trick.
Introduction to PHP
Tags: beginners, php
Published: 2019-05-28 15:56:42

PHP, or Hypertext Processor, as it full name goes, is a new generation scripting language that has extensive use in the web community. It is an interpreted and weakly typed language that was built solely for powering the web.
PHP is employed to "talk" to the server, i.e. accept input/feedback from the front end, proccess it and then work on the result on the server side.
PHP is also used to manipulate databases, MySQL being the most popular combination.
PHP is the driving force behind Wordpress, a Content Management system that enables non-coders and coders to rapidly build their own websites without too much stress. As at 2018, Wordpress powers over 30% of the world's websites.
Popular frameworks include: Lavarel, Cake, etc.
Beginners can get started with these links: https://www.w3schools.com/php/, https://www.youtube.com/watch?v=7TF00hJI78Y
How I met your Gatsby
Tags: challenge, gatsby, blogging, 30daysofgatsby
Published: 2019-05-28 15:22:34

---
title: How I met your Gatsby
published: true
description: A challenge i throw myself.
tags: #challenge, #gatsby, #blogging, #30daysofgatsby
series: The Great Gatsby
---

Hey guys,

I have been thinking about challenging myself to learn an entirely new concept lately. Lately have seen some challenges here in the challenge section.Pretty much greate and motivational .

So I wonder how would I challenge myself with a new tech. Since i wanted to start a blog to keep my findings in the near future i decided to go with some blogging platforms. I only researched a little about this. Found wordpress is kind of out of dated . Some of the bloggers i follow were migrated from wordpress to gatsby. Clearly I have no clue about **Gatsby**. I read terms like Graphql( which seems a good deal for the future), React( gatsby is in react i pressume) and so on. 

At work I  use angular and laravel for projects and still learning both.  Used to  work in React like 1 week or so. Maybe i can handle this.

I am thinking about taking 1-2 hours per day until 30th. Starting with this

But before starting i need proper research and **your expertise** in this matter. So let me know what you think about blogging, gatsby, react or anything comes to your mind regarding this matter.    

Also i am very much looking forward to update  sections i covered in regular interval.
CSS Plugin for Chrome
Tags: discuss, help, askdev, idk
Published: 2019-05-28 14:53:44

---
title: CSS Plugin for Chrome
published: true
description: Help me with the tool
tags: discuss, help, askdev, idk
---

Hello, a few days ago I saw a Chrome plugin (I think it was) that allows you to click an element and shows a popup with all the CSS applied to this element.
I think it's a great tool, and I want to use it, but I can't recall the name of it, or even I can't find it googling (or even duckducking).

Can anyone help me please?
Theme your app with Styled Components 💅 in Vue
Tags: vue, javascript, beginners, css
Published: 2019-05-28 14:41:33

Styled components are popular in the React community, and they give your components the power of css in js.

Vue can also use styled components via the vue-styled-components module.

```
yarn add vue-styled-components
npm install vue-styled-components
```

Using styled components is one way that you can create some interesting components.

In the following example, we can create a button that accepts props for various styling, and can then be mapped to input elements to allow for real time styling updates of the button.

{% gist https://gist.github.com/adamwhitlock1/da08a91cbfbe35725a18a28380978335 %}

Now, anywhere in our application we can use this styled component, and even bind dynamic data to these props.

{% gist https://gist.github.com/adamwhitlock1/cdeddaa0185803221dae7f3747cda282 %}

The above example shows us importing in the StyledButton.js, and then using this component in a vue single file component in a way that binds a few input elements to the data as well.

{% codesandbox 544xnq47pl %}

I usually like to use Tailwind CSS with my projects, so I will often add that into the mix as well. Here is another example of a similar idea with a styled component button.

{% codesandbox codesandbox-1ne69 %}

This example, also utilizes some simple transitions, toggle method, an alert that shows the current styling data, and an example of a more "static" version of the button along with the dynamically styled button.

Once these values are saved to something like local storage, or a user's preferences in a database, you can then use them to style the application dynamically.

I'm honestly not even really all that sure how useful this type of implementation is, since using data bound inline styles would offer a similar thing, but a fellow dev that uses react and styled components wanted to know if they were doable in Vue, so I gave it a shot. 

What other ways have you themed your vue applications dynamically?
Typesafe Mocking in TypeScript
Tags: typescript, angular
Published: 2019-05-27 14:24:53

---
title: Typesafe Mocking in TypeScript
published: true
description: 
tags: TypeScript, Angular
---

Say I have an Angular service `TodosApiService` with the following shape:

```ts
@Injectable()
class TodosApiService {
  constructor(private http: HttpClient) {}
  getTodo(id: number): Observable<Todo> {}
  getTodos(): Observable<Todo[]> {}
  createTodo(todo: Todo): Observable<number> {}
  updateTodo(todo: Todo): Observable<void> {}
  deleteTodo(id: number): Observable<void> {}
  private checkCache(id: number): Todo | null
}
```

Now say I want to code a class `MockTodosApiService` that can be used in place of `TodosApiService` and which returns mock data instead of making actual network requests. This might be useful for situations like testing or developing components in isolation in a system like [Storybook](https://storybook.js.org/).

How can I ensure that my mock class provides the same interface as `TodoApisService`? I.e. that I am implementing all the public methods from the service, and that I am returning the correct types? And that if somebody comes along and adds a method `bulkUpdateTodos()` to `TodosApiService` that they get a compile error unless they also add it to `MockTodosApiService`?

One way would be to create a TypeScript `interface` that both `TodosApiService` and `MockTodosApiService` implement:

```ts
interface TodosApi {
  getTodo(id: number): Observable<Todo> {}
  getTodos(): Observable<Todo[]> {}
  createTodo(todo: Todo): Observable<number> {}
  updateTodo(todo: Todo): Observable<void> {}
  deleteTodo(id: number): Observable<void> {}
}

class TodosApiService implements TodosApi { }
class MockTodosApiService implements TodosApi { }
```

In languages like C# or Java that would be my only real option, but it's kind of a pain. I now have three places to make changes keep in sync with each other.

However, the dynamic nature of JS and TypeScript's expressiveness provide a different option. I can instead use mapped types to tell the compiler that I want my mock class to provide the same public interface as the "real" service. It's as simple as this:

```ts
class MockTodosApiService implements Pick<TodosApiService, keyof TodosApiService> { }
```

TypeScript will now complain if I implement `MockTodosApiService` in a way that is incompatible with the public interface of `TodosApiService`. However, it will *not* complain about my not replicating the constructor, or the private `checkCache()` method and `http` field.

This works because `keyof` returns the names of every public field and method of a type. We then use the `Pick<>` mapped type, which returns a subset of a type's properties. The result is a type that contains only those properties from `TodosApiService` that are returned by `keyof TodosApiService`. And by saying that `MockTodosService` `implements` that type, I get compile-time checking that I'm doing so correctly.
Manage SSH access with AWS IAM
Tags: aws, productivity, devops, ssh
Published: 2019-05-28 13:23:47

---
title: Manage SSH access with AWS IAM
published: true
description: Manage Amazon Elastic Beanstalk SSH access with a script that synchronizes with the users of IAM.
tags: #aws, #productivity, #devops, #ssh
cover_image: https://thepracticaldev.s3.amazonaws.com/i/fff9eyxd4gtp6y239d7i.jpeg
---

When I started working at my current job I found that all the developers used the same key to access all the servers by ssh.

Looking for a solution I found a [script](https://github.com/widdix/aws-ec2-ssh) that synchronizes the ssh keys with the users of IAM.

![](https://thepracticaldev.s3.amazonaws.com/i/ymxvjdqgic8gt1u30x9g.png)

The problem was that all our infrastructure was based on Elastic Beanstalk and the solution was designed for EC2. If it was installed manually as in EC2 it would be erased when the instance is rebuilt.

To solve this problem, create a script that installs the package after each deploy (in case it is not installed previously) and then configure it.

{% gist https://gist.github.com/eesnaola/120428186b85fd8058d0e5730caf70dd file=configure_ssh_credentials.config %}

To use this script it is necessary to save it in the `.ebextensions` folder and then make a new build.

**Update June 2019:** Check out [Amazon EC2 Instance Connect](https://aws.amazon.com/es/blogs/compute/new-using-amazon-ec2-instance-connect-for-ssh-access-to-your-ec2-instances/) as a replacement for this script.

*For more documentation see the [GitHub](https://github.com/widdix/aws-ec2-ssh) repository.*
Increasing the Bus Factor on Frontend
Tags: productivity, webdev, career, discuss
Published: 2019-05-28 13:08:16

ℹ️ This is an article, I wrote last year on Medium.

Right now, as I am writing this, I am the only frontend developer on my team. This means that I am unofficially responsible for all frontend and it also means, that it is not tested very well. It may sound livable, but it can be dangerous in the long run if one team member works with a specific area.

It has been like this since another frontend developer got a new job. He was by the way also a senior developer. Now all frontend issues has my name on it, and that is really not the best way of managing the work of a team. *What if I also get a new job?* Then the team is in a very bad situation.

Normally, this is called the bus factor. It is the number of people in your team who can put your project in a bad situation if they get hit by a bus. Our bus factor on the frontend and the style guide is about 1.25. It is obviously a weird number. Of course, there can’t be 0.25 people. What I mean is, that I know most about frontend and the style guide, but there are a few team members who have looked into the project. The style guide is by the way a project where all frontend is being defined, and where CSS and JS is being outputted from.

I have been frustrated that there hasn't been much help or discussion about our front end. With that in mind, I chose to write an email to our team. I wrote it so I was sure to get it properly formulated.

>Hi guys,
>
>I think we should have a talk about the style guide.
>
>Since X said goodbye, I have been alone with frontend development and the style guide. If I get hit by a bus, the team are missing knowledge on this specific area. We can easily continue this way, but I don’t think it’s good for our team, my role in the team or my further development.
>
>I think a solution would be pair programming and more in-depth testing. It might also help if the style guide is going to be a part of the main project. Then it would not be an alienated project. That is maybe for an other discussion.
>
>It is not like the style guide is a whole different world. If you know HTML, SCSS, ES2015 and the architecture ITCSS and naming convention BEM — then you know the most essential.
>
>Knowledge sharing is important, especially when that knowledge depends on one person.
>
>Think about it and we will have a talk soon.
>
>Steffen 😀

We talked about the topic at our [Sprint Retrospective](https://www.scrum.org/). Here we defined some action points, which is something that we can improve on in the following sprint. In this case, it was more **pair programming** and a **presentation** of the style guide. The other team members would also do more thorough **code reviews**. I am also trying to make even more **documentation** on frontend development. I am right now preparing a **workshop** on frontend and the style guide.

I would love to hear if you have been in a similar situation. Have you also been alone with a certain part of a project?

Thank you for your time!

If you liked this, then please ❤️ and [*follow me on Twitter*](https://twitter.com/mrsteffenp).