teleren/devto huggingface dataset:
I'm Struggling At Work, Can You Give Me Some Advice?
Tags: help, motivation, mentalhealth
Published: 2020-06-25 11:04:58

TL;DR
We are working on an app for a crypto social currency for the city of Barcelona, it was started by another company and they stopped working on it and handle it down to us.

When we first started we made **tech-dept** calculation and it gave us something like **3.6yrs** for a 1 yr project... crazy... We started working on it little by little, refactoring here and there... it's been 2+ years since we started. But as usual, we were faced with new features and bug fixes that took us of course from refactoring, so tech-dept has not been reduced that much...

Many times they've also asked for a feature they need ASAP, we have done it at the cost of letting another project aside and/or working more hours... in the end, they didn't even want to dispatch it... this has happened 3-4 times already...  

There is also the point that I'm the only developer working on the app, and communication is not very good lately so I feel alone quite a bit, and feel like I'm a machine that receives requests and dispatches code... which I'm not, I'm human and have feelings.

I have also been fixing loads of bugs introduced because of bad design by their part, and make me feel like it was my fault... I can handle this somewhat, because I know it was not my fault. But when it's a recurring thing, it starts to add up and can be really frustrating and depressing.

Lately, I've been struggling to find motivation and willingness to work on the project, mainly because the bad quality of the codebase and the little interest on the team's side to improve the app or at least acknowledge that It's rubbish, and I'm doing more work than needed. It's also giving me a lot of anxiety thinking about working on the project, as I know how much work and headaches I will have whilst working on it... and knowing that I'm alone does not help at all...



I would love to know how you guys and girls handle this kind of stuff, what would you do in my situation? 
* Should I embrace it and just f**k it? 
* Should I try and be more serious about the importance of improving the codebase (not just only to improve the app but for my own sanity) and talk with the team even more?  

Any advice or help is really appreciated. And if you read up to here, I must thank you for taking the time to try and help :)
Cheatsheet for Kubernetes (MiniKube & Kubectl)
Tags: cheatsheet, minikube, kubectl, kubernetes
Published: 2020-06-25 10:52:37

# MiniKube

*Ref: https://kubernetes.io/docs/setup/learning-environment/minikube/*

Start up a single node Kubernetes cluster
``` powershell
minikube start --kubernetes-version=<version> --driver=<driver_name>
------
e.g.
minikube start --kubernetes-version=v1.18.0 --driver=docker

Minikube supports the following drivers:
---
docker, virtualbox, podman, vmwarefusion, kvm2, hyperkit, hyperv, vmware, parallels, none
```

Get the status
``` powershell
minikube status
```

Visit the dashboard
``` powershell
minikube dashboard
```

Stop a cluster
``` powershell
minikube stop
```

Delete a cluster
``` powershell
minikube delete
```

List available addons
``` powershell
minikube addons list
```

Enable an addon
``` powershell
minikube addons enable metrics-server
```

Disable an addon
``` powershell
minikube addons disable metrics-server
```

Proxy to a cluster service
``` powershell
minikube service <service_name>
```

---

# Kubectl

Set the cluster configuration file that Kubectl should refer
``` powershell
kubectl config use-context minikube
```

Show the Kubernetes client and server versions
``` powershell
kubectl version
```

Create deployment
``` powershell
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
```

View deployments
``` powershell
kubectl get deployments
```

View pods
``` powershell
kubectl get pods
```

View services
``` powershell
kubectl get services
```

View pods and services
``` powershell
kubectl get pod,svc -n kube-system
```

View events
``` powershell
kubectl get events
```

View kubectl configuration
``` powershell
kubectl config view
```

Expose the pod to the public internet
``` powershell
kubectl expose deployment hello-node --type=LoadBalancer --port=8080
```

Delete the services
``` powershell
kubectl delete service hello-node
```

Delete the deployments
``` powershell
kubectl delete deployment hello-node
```

---

# YAML Reference
### Deployment
#### Example 1
``` yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloworld-web
  labels:
    app: helloworld-web
    tier: frontend
spec:
  replicas: 2
  selector:
    matchLabels:
      app: helloworld-web
      tier: frontend
  template:
    metadata:
      labels:
        app: helloworld-web
        tier: frontend
    spec:
      containers:
      - name: helloworld-web
        image: ssmak/helloworld_web:latest
        ports:
        - containerPort: 80
        - containerPort: 443
```
CSS Only Navigation Menu
Tags: codepen, html, css, showdev
Published: 2020-06-25 10:47:26

<p>This is a navigation menu without using any Javascript code.</p>

<p>I used animation loop on the the 'Rounded' growing overlay of the navigation menu.</p>

<p>I used the 'hidden checkbox' approach to show or hide the menu box.</p>

<p>The 'hamburger menu', and the 'X' link is a label, pointing to the ID of the checkbox. So that, I could trigger the checkbox toggle while clicking on the other element.</p>

<p>I designed the animations of the 'hamburger menu' and the growing overlay.</p>

<p>This navigation menu is optimised for PC browser.</p>

{% codepen https://codepen.io/takaneichinose/pen/aNrBKp %}
Why Not to Use Root User?
Tags: devops, linux, ubuntu, security
Published: 2020-06-25 10:42:23

We all know that it is a bad practice to use root user. But not everyone of us may know the exact reasons. So here are some reasons to remember;

**🔐 Security:** All the hackers know that there is a root account and they would target the root account to breach in. To be safe and secure, root account should have logins disabled.

**📳 Applications' Vulnerability:** When an application is served using the root account, in case of vulnerability, hacker can execute code remotely and gain access. Also your application can erase important files or directories mistakenly.

**🙊 Mistakes:** Just like you and me, everyone else can make mistake. While rushing, one can run a command and find himself like "Holy Root! What have I done!". However, typing in "sudo ..." and password would give someone enough time to think twice.

**👉👈 Accountability and Responsibility:** To have a clear accountability and responsibility map, users should always use different user accounts based on their roles. This way, we would know who did what and who is responsible for what. 


**⭐ Solution ⭐:** "Least Privilege Principle" is a very good rule of thumb. Give users the least privilege to accomplish a task. This way you are not discriminating your colleagues nor are you having less trust in them. You are in fact making everyone safe, including your colleagues from unintentional mistakes, your users from being compromised and your organization from a humiliation. 
Thank you for reading 🙂 Stay safe and healthy 👋
Stop Formatting Your JavaScript Code Manually
Tags: javascript, vscode, productivity, beginners
Published: 2020-06-25 10:39:14

Are you still formatting your code by hand? [Ain't nobody got time for that.](https://youtu.be/waEC-8GFTP4?t=30) In this post I'll show you how to install **Prettier** and **EditorConfig** on **VSCode**. I am assuming you are relatively new to JavaScript, so I'll be only focusing on formatting rather than linting. Trust me, this will increase your quality of life by a margin. And, in my opinion, this is the easiest way to get formatting work on VSCode.

###**What is Prettier?**

Prettier is an opinionated code formatter which supports JavaScript, JSX, JSON, React, Vue, Angular, etc. Prettier is not a linter. It only follows formatting rules, not code-quality rules. You can see which rules it supports here, and create your own config file: [Prettier Playground](https://prettier.io/playground/).

###**1. Install Prettier and EditorConfig**

Open VSCode and press **CTRL + P**. After that enter this:

```
ext install esbenp.prettier-vscode
```

And this:

```
ext install EditorConfig
```

After installations are done; go to **Settings**, and search for **formatOnSave**. Make sure it is **ticked**.

###**2. Add Configuration Files to Your Project**

You need to have these config files in every project you want formatting to work. Create a **.prettierrc** file in the root folder of your project. You can use mine to get started:

```json
{
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "semi": true,
  "singleQuote": true,
  "quoteProps": "as-needed",
  "jsxSingleQuote": false,
  "trailingComma": "none",
  "bracketSpacing": true,
  "jsxBracketSameLine": false,
  "arrowParens": "always",
  "requirePragma": false,
  "insertPragma": false,
  "proseWrap": "preserve",
  "htmlWhitespaceSensitivity": "css"
}
```

Lastly, let's create a **.editorconfig** file in the root folder, so that VSCode knows you want your tabs to be 2 spaces long:

```
root = true

[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
```

That's it! Now every time you save your code, it'll automatically get formatted.

---

I hope this was useful, you can also follow me on Twitter for future content:

[twitter.com/oznbll](https://twitter.com/oznbll)
Search and WordPress Shortcodes
Tags: wordpress, search, algolia
Published: 2020-06-25 05:47:58

My wife and I run a WordPress blog about our family, and I’ve incorporated the Algolia plugin to replace the default search to improve it. With its addition, search suggestions and search-as-you-type improves the whole experience (if I do say so myself), especially in showing text match snippets in the results. I did notice something odd, however:

<figure>
![Screenshot of WordPress search with shortcodes appearing in result snippets](https://dev-to-uploads.s3.amazonaws.com/i/7fudlt5qtj9j7m6kmd3b.png)
<figcaption>A shortcode appears in the first search result's snippet.</figcaption>
</figure>

As you can see here, snippets include shortcodes. In case you aren’t aware, shortcodes in WordPress are special codes written inside square brackets. They’re stored in plain text as part of the page or post, but WordPress’s rendering process converts them on the fly into whatever content they’re actually supposed to be.

In the above image, you can see the beginning of a shortcode: `[aesop_video`. This is because for quite some time, I had been using a plugin called Aesop Story Engine to contol the display of images and videos in my posts. This was well before Gutenberg gained traction, which for themes which enabled it, could break media out of the normal post width. (Aesop did it first. 🙂)

Unfortunately, this resulted in an unpleasant side effect of showing the shortcodes (which are stored in plain text) in the type-to-search powered by Algolia. The only way to fix this is to go through every post with Aesop shortcodes, replacing them with the equivalent Gutenberg block.

I’ve lost track of how many posts I’ve updated. I’m down to about 250 more to go…

----

_This post was originally published on [Bold Oak Design](https://boldoak.design/blog/search-and-shortcodes/)._
Things to Check Before Pushing Your Code
Tags: codenewbie, python, codequality
Published: 2020-06-25 10:37:03

In this article, I will talk about what you need to check before pushing your code. The scope of the article is checks about your code and the factors that will facilitate the work of those who will review or make edits later ; not about your code performance. Lets get started

#1- Naming
   Make sure that any variable, function, class name, loop variables do not contain special characters of your mother language.

   The names of variables, functions, class names, loop variables has to accurately reflect their purpose and neither be short nor too long.

   Other than loop variables, single letter (i, j, k, l) variable names should not be used. In fact, since the variables of the loop serve a purpose, they should get proper naming for their purpose.

#2- Readability

  Although the lines of comments seem unnecessary in the instant of the software development, it makes it easier to read and modify the codes. Making a description of what the rough draft does for the class, the function or a variable or even a loop does not hurt for the program developer,
it will also provide an advantage for those who will code review the program.

 Editing the code in accordance with the standards for more readable code of the software language. 
(PEP8, Python) (Swiftlint, Swift) etc.

 Logging is very important to know what your code is doing while working. Attention should be paid to the degrees of logging. 

#3- Adding, Commiting, Pushing

 The place of the code you write in version control systems is very important. The first thing to note is that we are in the right branch. If there is, we should make sure that the epic branches belong to the correct branches.

 In your commit, you only need to add the files that you want to affect the entire source code.
 Your commit message should be such that it can give an idea of ​​the whole work.

It is very critical that the code you write can be understood by your teammates and who will edit your code later.
The API mindset and skillset
Tags: podcast
Published: 2020-06-25 10:33:45

**Trick question of the week:**
*What is the API mindset and skillset?*

APIs are used widely in tools most of us use daily. What is this API mindset though and why are APIs important?

Mehdi Medjaoui, our guest in our most recent episode is the man to answer these questions.

Simply put, the API mindset is thinking
**“How can I make my software, program or technology available to as many users as possible at zero implementation cost?”**.

In this episode, we discuss:
* A brief history of APIs
* The API mindset and the skillset that goes along with it
* The benefits of focusing on APIs
* The untapped API potential and how APIs will evolve in the future
* apidays INTERFACE event coming on June 30

[Listen to the full episode] (https://www.devrelx.com/podcast?utm_source=devto&utm_medium=Mehdi&utm_campaign=podcast):
{% spotify spotify:episode:1y6ZbDtJS15C4us55YbkcW %}

The graph Medhi talked about in this week’s “Let’s talk Data” section: [Number of people involved in software development in company](https://www.devrelx.com/trends?lightbox=dataItem-k9mq59e3?utm_source=devto&utm_medium=Mehdi&utm_campaign=Devsincompany). 

[You can grab your ticket for APIdays INTERFACE here] (https://www.apidays.co/interface?utm_source=SlashData_Podcast&utm_medium=Mehdi_Episode&utm_campaign=apidays_promo). The event will run from June 30 – July 1st in 3 time zones, so you can rest assured you won’t miss something. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9y4kde6ctd0y9jt0ur3f.jpg)

**Mehdi Medjaoui** is the founder of the worldwide apidays conferences series he started in 2012 in Paris. Mehdi is highly involved in the API community and API Industry, as author, lecturer, consultant and investor in the API tooling space. His industry research involves publishing and maintaining the API Industry Landscape and the yearly State of Banking APIs. In 2019, Mehdi become H2020 European Commission expert to lead the APIS4Dgov study on public sector and government APIs. As entrepreneur, Mehdi co-founded in 2014 OAuth.io that was acquired in 2017. Mehdi’s new venture GDPR.dev develops a Personal data API framework and protocol to democratize data regulations usage for mass users and compliance for applications developers, making GDPR programmable.

[Originally published at DevRelX Blog.] (https://www.devrelx.com/post/api-mindset-and-skillset-with-mehdi-medjaoui?utm_source=devto&utm_medium=Mehdi&utm_campaign=Article)
GraphQL in 3 mins!
Tags: node, javascript
Published: 2020-06-25 10:18:55

GraphQL is a data query language developed by Facebook in 2012 and they made it public in 2015. Within this 3–4 years, many top companies have adopted GraphQL. Github, Twitter, PayPal, Pinterest, Coursera, New York Times, Shopify are few to name. Nowadays, it seems like, GraphQL has gained enough momentum to be a very 🔥Hot Topic🔥! If this is the case, then we should at least know what it is, right? Lets dive in!

When you say "Data Query Language", it does not make a lot of sense. Lets make it simple.

> GraphQL is an alternative to REST API.

In REST API, one App may have hundreds of end points.
```
/api/users/
/api/posts/
/api/news/
/api/blah/
```
But for GraphQL, it will have only one!
```
/graphql       or        /anythingYouLike
```
Say, you need usernames and emails of users from some-site.com, for some reason. So, you send a GET request to some-site.com/api/users/. It sends you all the usernames and emails along with all the other data it had about the users.
```
[{
  username: "someName",
  firstName: "Mr.",
  lastname: "someName",
  email: "someName@email.com",
  age: 28,
   .
   .
   .
  and 100 more fields
}, 
{...}, {...}, ... ]
```
This is very kind of REST API, but might be overwhelming!
For GraphQL, you would send a POST request to some-other-site.com/graphql with the following body
```
query users {
  username
  email
 }
```
It would bring you the formatted data you were looking for!
```
[{
  username: "someOtherName",
  email: "someOtherName@email.com",
}, 
{...}, {...}, ... ]
```
Sounds cool right? There is more!

As you are building a REST API, you need to use a third party software like "postman" to check if everything is working fine. For GraphQL, it ships with a built-in "Adorable" query interface.

![graphQl Playground](https://dev-to-uploads.s3.amazonaws.com/i/yhz98gcx04lofphg9nul.png)

Right section of the image above shows some documentation, which is auto-generated!

Are you excited enough to play with the GraphQL interface? Guess what? I got a demo App for you!

`Live: https://despider-graphql.herokuapp.com/graphql`
`Github: https://github.com/despider001/graphql_event_booking`

It is an event booking App, which lets users createEvent, bookEvent or cancelBooking. Just copy-paste the query below in the query section and click the play button to see it in action.
```
{
  getEvent {
    title
    description
    date
  }
}
```
GraphQL ships with a lot more fun than what I mentioned above. To learn more, simply google it😉

Have a great day! 👋🏼

Twitter: @Sadiqur_Rahman_
How to get rid of branch name from git push origin master

Tags: git, github, beginners
Published: 2020-06-25 10:13:08

We always type `git push origin master`, while working on feature branch we type `git push origin JIRA-1`, sometimes the names of the feature branch is not easy then we use `git push origin this-branch-will-do-something` to push the code over GitHub or any other hosting service. In each case, we are doing redundant work of copy-pasting or typing branch name which is redundant and annoying as you have to remember the branch name exactly or you might end up pushing the code to the wrong branch. This can be handled by just with one command,

```bash
git config push.default current
```

So this command push changes to `.gitconfig` file and after change git config file looks like this:

```bash
[user]
  name = author
  email = author@itsopensource.com

[push]
  default = current
```

You can directly append in git config too.

After this, all you need to do is:

```bash
git push origin
```


**Note** - If you do this inside a git repo, this will only be available for that repo, if you want to do it globally and add ``--global`` flag:

```bash
git config --global push.default current
```


This will make these changes to be set globally across all the git repos you are using.

Happy git!
Naming Conventions in 3 mins
Tags: node, javascript, typescript
Published: 2020-06-25 10:10:26

![Naming Convention](https://dev-to-uploads.s3.amazonaws.com/i/3pn8hu2juqzazoqj4c4u.jpg)
There are so many different ways you can name your variables (naming conventions). If you are a beginner, most probably you don't care a lot about naming. But if you are working / planning to work in a team, lets learn a bit of naming conventions before you embarrass yourself. 😉
Here are some common conventions;

**🐫 Camel Case:** First word of the variable has to start with a small letter, then the second or third word will start with capital letter. Examples: newVariable, iLikeCamelCase. Used for assigning string, number, boolean, object, array, list and so on.

**👵🏽 Pascal Case:** It is like camel case, except for the fact that it starts with a capital letter. Examples: NewVariable, ILikeItToo. Mainly used for declaring a class and it's types (Object Constructor Function, Interface…).

**🐍 Snake Case:** Here we have small letters with underscore (_) separation, like this_one. They are very handy for object keys and for database fields. This could also be used to declare a really_really_loooong_variable.

**🍖 Kebab Case:** In this type, small letters are grilled together using hyphens, just-like-this-example. You can use it for routes (url) for instance, if you wish.

**😠 Screaming Case:** All capital letters, to YELL at people. If you want to hard code a value like TAX=10%, you can use SCREAMING_CASE.

**⁉️ Hungarian Notation:** In this type, names start with a lowercase prefix to indicate the intention. Example would be sName, nAge. Since in JavaScript, we don't have typing (string, number…), we can use hungarian notation to give a hint about the variable's type (s for string, n for number…).

**_Underscore before a variable:** This is a very common practice to declare a _privateVariable that cannot be accessed outside of a class.

To sum up, it is always a good practice to apply the "good practices" in your code. This makes your code more understandable, maintainable and most importantly makes you feel cool 😎

I wish you a safe, healthy and happy coding! 👋

Twitter: @Sadiqur_Rahman_
Call subreport in main report using jasper report by clinking on jButton1 netBeans.
Published: 2020-06-25 09:18:50



I want to make a report in jasper view using NetBeans jButton1, in preview, I can see all the subreports but after I run it through NetBeans the report comes with the main report and without subreports. Your help will be more appreciated, please.

InputStream file = getClass().getResourceAsStream("/MyTech/New/Home.jrxml");
JasperDesign jDesign = JRXmlLoader.load(file);
String query = "select sales.*,clients.* from sales,clients";
JRDesignQuery updateQuery = new JRDesignQuery();
updateQuery.setText(query);
jDesign.setQuery(updateQuery);
JasperReport jReport = JasperCompileManager.compileReport(jDesign);
JasperPrint jPrint = JasperFillManager.fillReport(jReport, null, con);
JasperViewer.viewReport(jPrint,false);


This is the look in preview while checking if it is well done https://i.stack.imgur.com/3Gxzr.png

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

This the look after clicking the jButton1 in NetBeans. https://i.stack.imgur.com/Iv0KP.png

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4a6206lxlyl45ww35xv7.PNG)