teleren/devto huggingface dataset:
How to make a nice high dev salary into not as much, frugally
Tags: money, industry
Published: 2021-05-07 17:34:35

---
title: How to make a nice high dev salary into not as much, frugally
published: true
description: 
tags: money, industry
---

Let's say you are senior and have a lot of experience and make well above the average salary and you aren't located coastal where everything is in a bubble. Let's take a nice round number, $150,000 salary.

1. Max out your 401k. -> 150 - 19 = 131
1. Max out your IRA *AND* your spouse's IRA. -> 131 - 12 = 119
1. Max out family HSA. -> 119 - 7 = 112
1. Max out ESPP @ 10% of your salary. -> 112 - 15 = 97
1. Save $3600/yr for child's college. -> 97,000 - 3600 = 93,400

Wow, 37% ($56,600) of income is going to saving for the future and 68% ($38,000) of that is before taxes.

I was reading this post by Troy Hunt https://www.troyhunt.com/10-personal-finance-lessons-for-technology-professionals/ and I realized I wanted to know my own numbers and so I ran these myself (These are not exactly my numbers).
Concurrent Thinking Might Lead to Better Code
Tags: go, kafka, concurrency, programming
Published: 2021-05-07 17:33:18

---
title: Concurrent Thinking Might Lead to Better Code
published: true
description: a thought dump on concurrency
tags: Go, Kafka, Concurrency, Programming
//cover_image: https://direct_url_to_image.jpg
---

For whatever reason I was listening to [Rob Pike talk about Concurrency is not Parallelism](https://www.youtube.com/watch?v=oV9rvDllKEg) yet again.  I had also been using Kafka for the first time recently.  It triggered an epiphany.

I first heard about Kafka around six or seven years ago.  I asked what it was and I was told of its wonders and how it would solve all my problems and make everything better and how any app not written around Kafka was inferior and it is the future and blah blah blah.  I immediately disregarded it all and ignored it.

Having now used it, I can say for certain that I don't know what the fuss is about.  I'd never choose to use it again.  I'd never design an app around it.  I would, instead, strive for simplicity and solve the types of problems which Kafka solves a different way, preferably by avoiding them altogether.

Now, while listening to Rob Pike talk about concurrency it occurred to me one possibility why Kafka was so beloved by those who espouse it.  It is a JVM project and far more heavily used in that circle than outside of it.  JVM folk are very likely used to a certain way of doing things and building around Kafka entirely breaks those ways.  It shakes things up, possibly in a good way.  Kafka creates a communication boundary that wouldn't have otherwise existed in a monolithic JVM app.  Kafka creates the need for multiple processes doing smaller tasks utilizing varying Kafka features, rather than a single monolith.  The requirement of these structures could be a huge benefit and explains the sentiment which I heard all of those years ago.

I think I've learned a bit thinking about these things...

... or I'm completely full of shit.
HTML : Superscript and Subscript
Tags: webdev, html, codenewbie
Published: 2021-05-07 17:28:23

To offset text either upward or downward you can use the tags `<sup>` and `<sub>`.

To create superscript:
```html
<sup>superscript here</sup>
```

To create subscript:
```html
<sub>subscript here</sub>
```

<a href="https://www.buymeacoffee.com/rkycom" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

With all that being said, I highly recommend you keep learning!

Thank you for reading this article. Please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/www-rajeshkumaryadav-com/) and [Twitter](https://twitter.com/rky_com).
HTML : Inserted, Deleted, or Stricken Tags
Tags: codenewbie, html, webdev
Published: 2021-05-07 17:24:39

To mark text as inserted, use the `<ins>` tag:
```html
<ins>New Text</ins>
```

To mark text as deleted, use the `<del>` tag:
```html
<del>Deleted Text</del>
```

To strike through text, use the `
` tag:
```html

Struck-through text here

```
<a href="https://www.buymeacoffee.com/rkycom" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

With all that being said, I highly recommend you keep learning!

Thank you for reading this article. Please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/www-rajeshkumaryadav-com/) and [Twitter](https://twitter.com/rky_com).
HTML : Abbreviation
Tags: codenewbie, webdev, html
Published: 2021-05-07 17:22:04

To mark some expression as an abbreviation, use `<abbr>` tag:

```html
<p>I like to write <abbr title="Hypertext Markup Language">HTML</abbr>!</p>
```

If present, the title attribute is used to present the full description of such abbreviation.

<a href="https://www.buymeacoffee.com/rkycom" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

With all that being said, I highly recommend you keep learning!

Thank you for reading this article. Please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/www-rajeshkumaryadav-com/) and [Twitter](https://twitter.com/rky_com).
Customise Ubuntu Terminal
Published: 2021-05-07 16:50:45

**Install zsh**
`sudo apt install zsh -y`

**Download oh-my-zsh**
`sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"`

[Download custom font](https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf)

**Install powerlevel10k**
`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k`

**Install Auto suggestions**
`git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions`
SonarCloud vs LeftShift for automated code quality and security checks
Tags: security, productivity
Published: 2021-05-07 16:49:09

Lately, I have been looking for automated tools to improve the quality and security of my apps. I have looked at two online apps for this, SonarCloud and LeftShift.
They are both intuitive and easy to setup; they can also be connected to GitHub and GitLab to examine repositories automatically every time a new commit is pushed.
ShiftLeft requires access to all repositories, while SonarCloud gives the option of only allowing access to some repositories.
ShiftLeft identifies security issues in the code and scored them according to severity.

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

SonarCloud provide a more extensive report, including three sections: reliability (are there any bugs?), maintainability (is the code clear and well-structured?) and security (are there any vulnerabilities?).

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

At first sight, SonarCode is more comprehensive, as it looks at the general code structure and how maintainable it is as well as security issues. However, when I analysed the same app with both tools, they suggested different security issues that should be fix. In conclusion, I will probably use them both as they provide complementary information.
Special Variables in Shell Scripting
Tags: linux, shell, beginners
Published: 2021-05-07 16:43:49

In this article, we will be seeing what are the special variables available and its purpose in shell scripting.

**1. $0** - This variable will be provide the filename of the current script.

**2. $n** - These variables correspond to the arguments with which a script was invoked. Here n is a positive decimal number corresponding to the position of an argument (the first argument is $1, the second argument is $2, and so on).

**3. $?** - The exit status of the last command executed.

**4. $$** - The process number of the current shell. For shell scripts, this is the process ID under which they are executing.

We will see the example scripts.

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

After running the above script,

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qzsepxb0ar4b6qy4ymyh.png)
  
 
**5. $*** - All the arguments are double quoted. If a script receives two arguments, $* is equivalent to $1 $2.

**6. $@** - All the arguments are individually double quoted. If a script receives two arguments, $@ is equivalent to $1 $2.

Many will find the above variables will return the same output but there is subtle change. 

Let me show you with the example, this time with rm(remove command) since echo will not show much difference.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ot130dms0nf5ab9zaef.png)
 
Running the above script

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kvpw6lw17fhwqaf8xw9g.png)
 
**$@** and **$*** returns the same output but **"$@"** took only double quoted argument as single argument and **"$*"** took entire arguments as single argument

**7. $!** - The process number of the last background command.

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



Hope it helps :)
Simple MVC Security in ASP.NET | Blog Security pt. 1: Locking it down
Tags: csharp, dotnet, webdev
Published: 2021-05-07 16:40:36

I'm working on a full fledged blog site ( I currently plan to post on dev.to as well, but its a project to show potential employers) and I've just learned how simple it is to implement security.  Its almost completely built in to the template, I'll show you how to leverage it to make your site more professional and secure. 

# What you need to get started
I'm using my Blog project I've spent about a week on, but you don't need anything in depth to try this out.  What I'd recommend is a simple scaffolded MVC with ASP.NET Core, Setup your database however you like so it handles user accounts, and we can get started.

As a quick overview, I have a few models, the ones we'll be working with are blogs (collections of posts) and posts.  

# Step 1: Denying access
![You shall not pass](https://media.giphy.com/media/8abAbOrQ9rvLG/giphy.gif)

In my blog application currently anyone can edit the database, which is bad.  I don't want Anyone who stumbles on the site to be able to create a blog without registering and having permission from myself, and I definitely don't want them deleting my hard work.  So lets lock it down!

In the controller for my blogs, right in front of my create get action, I'm going to add one simple line of code `[Authorize]` and then ensure that the `using Microsoft.AspNetCore.Authorization;` directive is at the top of my controller.  (use ctrl+. to fix this error when the red error ramen comes up).

This Locks out any unregistered user from the page, and redirects them to the login page to put them on track.  


# Step 2: Allowing a little access
![unlocked](https://media.giphy.com/media/3o6Mb2WBUzb7PGcgj6/giphy.gif)

Since anyone can register, this is a bit like closing the door but leaving it completely unlocked.  If the user is smart enough to register (Most are) they're going to get through the rigorous security.  If we beef things up a little we can only allow administrators into the create blog posts.  `[Authorize(Role = "Administrator")]` solves the problem.  They will be asked to log in, and then met with an access denied message instead of the ability to create a blog.  

I'd rather them not access most of the blog controller, just the index of blogs.  Taking a more drastic measure is to instead add `[Authorize(Role = "Administrator)]` to the entire class.  Now access denied will show up for all actions within the Blog controller.  On the Index and details actions, we can add `[AllowAnonymous]` to ensure.  This will let Anonymous users back in, so they can browse the blogs and see their details. 



This works, but there is a pretty big oversight.

![Locked out ](https://media.giphy.com/media/xUySTL60dNkQJJGmnS/giphy.gif)

The temporary fix is to remove the security so you can work on it.  
We'll fix that in my next blog, which will cover Assigning roles and changing whats displayed to the user.
Usage of git stash
Tags: git, github, opensource, coding
Published: 2021-05-07 16:31:05

# So Whats The Matter ? 
from somewhere in the internet
![intro](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSHzkErUAOXnV51c7Xh-v9N3zcOMcTXw857Ag&usqp=CAU)
## Will It ? 
Imagine this, you were  working on some feature that hasn’t been completed  and something important came up and you dont  want to commit this partial feature with that urgent feature that you added and during this situations, there are a few options :
# Horrible one

# Reset all the changes and clean out un-tracked stuff
``
git reset HEAD --hard
git clean -fd
``
You can do this if  there isn’t much that you have done since the last commit. But  if you ve spent hours working on it and you are about to complete that? Not a good idea then.

# The Correct Way :
You should use git-stash

``git stash``
Just consider it like a clipboard, running this command will move all your changes to stash. After that you can start working upon that urgent feature, commit that and once you are ready to start working upon that partial feature that you were working upon back at the point when you had to stash the changes, you can get your stashed changes back to your working copy by : 

``git stash apply
``
You can clear your stash by using : 
``
git stash -u
``
and no it will not stash your untracked file

for stashing untracked files you need to run : 
To stash untracked files as well, you need to do

``git stash -u
``
# Time for some meme's
from multiple sources : 
![1st](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRFa8CX1gEvmZ4VzNwJOzVBtE8lWlieOhslAA&usqp=CAU)
![2nd](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS4N9SpUE72J9-LGIpthEfDvOM7lHrSmXs-jg&usqp=CAU)
![3rd](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSJ25JEFRxs1Vn7qFDbnwRchVPAHeqDO2r9Kw&usqp=CAU)
![4th](https://anorman728.com/wp-content/uploads/2019/06/gitstash.png)
# commit your thoughts in the comment section 
 # Conclusion

# Keep Coding !!!

# 🙏 Share with your friends on [Twitter](https://twitter.com/intent/tweet?text=%22Usage%20of%20git%20stash%22%20by%20@alestor123%20%23DEVCommunity%20https://dev.to/alestor_123/usage-of-git-stash-3842)
Props vs State in React 
Tags: react, javascript
Published: 2021-05-07 16:30:23

Let’s start with the definition of props and state in React.

**“Prop”** is an object and used to pass read-only data from one component to another. Data can only be sent by parents to child components dynamically.

**“State”** is a built-in React object where we can store property values. When the state object changes, the component re-renders. 

In order to be familiar with each one, let’s give some examples below;
 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xhgsxnfeb3y8k2ua5klb.png)
 
The reusable **date** variable that has the current date is being passed to the Header component with the special **currentDate** keyword.

 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/alotfjll4zpub3my65ep.png)
 
In the Header component, we can easily use the prop **– currentDate –** passed by App.js

**Props** are used to pass data, whereas **state** is for managing data. – www.freecodecap.org.

 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2t4vkhlfxymktfoa11hk.png)
 
In the example above, we initially imported **useState** object from the React library. Then we have created two different **useState** objects. The first one consists of **task** array and **setTask** setter function. The second one is having **taskInput** variable and **setTaskInput** setter function which changes the **taskInput** value whenever the user types on the input field. By the time the button is clicked, **setTask** function updates the **task** arrays in response to the state change and re-renders Task component to display the added task on the page. 

**Conclusion**
**Props** are used to pass data to the child components while **state** is used to store the data and let the component render to modify the screen.
I hope this helps clarify the difference between the props and state in React. Thank you for reading!
Stop Stressing Users OUT! 😳🙅🏽‍♀️
Tags: ux, design
Published: 2021-05-07 16:23:48

Lately I've been working on my project "Hyper Writer" which is *supposed to* help me to write more.

One of the ways it does this is by trying to convince you to write 750 words each day without editing.

This is great because it acts as a sort of "mind dump" that helps you get your thoughts out and find things that would be great to write about. 

The problem is, I wasn't doing it.

At first I tried to introduce a sort of "streak calendar" which would color days you've written and leave the other ones a depressing gray color:

![Screen Shot 2021-05-07 at 6.03.04 AM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xoqclnpnvapmw4d896kv.png)
 

But lately when I pulled it up I just kind of felt this *dread*. I'm a busy parent of 3 small kids... I don't have a ton of time to write. Even 30 mins can be a big time commitment for me and often if life gets in the way I feel like a failure.

## More positivity, less guilt

The answer of how to improve it came from an unexpected source. Trying to make the landing page.

The more I read and watched about marketing the more I realized an important principle:

> Don't talk about the **work** they are going to have to do
> talk about the **benefits** they are going to get

I know, sounds like "no duh!" but look at how much work my interface was *implying* that I do:

![Like this](https://tmp.f8.n0.cdn.getcloudapp.com/items/8LubeKg7/7e37721e-c817-4588-9c89-73164cfa20fd.jpg?source=viewer&amp;amp;amp;amp;amp;amp;amp;v=6ff0b8837aabb17327ae85f673625b4a
)

Now compare the new one:

![Message about how we should write down today's troubles and unburden your mind](https://tmp.f8.n0.cdn.getcloudapp.com/items/RBuYRDW8/78486b01-8973-4bac-9a55-0c173984457e.jpg?source=viewer&amp;amp;amp;amp;amp;amp;amp;amp;v=c194366aa760fe0624b1489232943949)

Now I click it every day! Let's dive into this a bit more

### Button Text

**Before**: 😰 Why would I want to WRITE TODAY'S BONE, that's just more work for me, it's daunting because I know I'm going to have to write 750 words
   
**After**: 🧘‍♀️"**Unburden your mind**" feels like such a relief! Of course I want to click that button!


### Worry about Streaks *after* you succeed

**Before**: 😡 the streaks calendar creates an insta-guilt trip at the start of each day. You walk into the app and it says, *"guess what! You're already behind again!"*

**After**: 🤗 Hiding the chart till AFTER I succeed stops the instant guilt trip. Also, the message under the button tells you just 1 word is enough, but you *know* that when I start writing I'll write more than that. 

## Result

![Done it every day](https://tmp.f8.n0.cdn.getcloudapp.com/items/12uAj84J/85afae28-c93e-4fe8-bccb-82caf6e600fa.jpg?v=f2175897db00aa4bc0874b09710f4195)

So maybe try making more changes towards calm and positivity and it see if it helps you too!

#### References
- This Microconf talk [Lizards Thru Doorways: Proven Ways to Widen Your Funnel Using Just Your CTAs – Joanna Wiebe](https://youtu.be/F_urkVueszI)
- [Hary's excelent blog on marketing](https://marketingexamples.com/)
Kotlin Singleton with Object Declaration
Tags: kotlin, declaration
Published: 2021-05-07 16:15:24

https://grokonez.com/kotlin/kotlin-singleton-object-declaration

Kotlin Singleton with Object Declaration

In object oriented programming, there is a common situation when you want a class to have only one instance. In Java, we usually implement using the Singleton Design Pattern: define a class with a private constructor and a static field holding the only existing instance of that class. This tutorial shows you a way to implement Singleton with Kotlin Object Declaration.

<!--more-->
<h2>I. Technology</h2>
- Java 1.8
- Kotlin 1.1.2
<h2>II. Overview</h2>
Kotlin provides object declaration feature with keyword <code>object</code>.

We use <code>object</code> keyword in several cases, but they all have the same core idea:
- defines a class, and at the same time
- creates an instance (an object) of that class 

Like a class, an object declaration can contain declarations of <em>properties</em>, <em>methods</em>...
<pre><code class="language-java">
object Singleton {

	init {
		...
	}

	var a: Int = ...

	fun doWork() {
		...
	}
}</code></pre>
But <em>constructors</em> are <strong>not allowed</strong>. Object declarations are created immediately at the point of definition, not through constructor. So defining a constructor in this case doesn’t make sense.

Object declarations can also inherit from <code>class</code> and <code>interface</code>.

You can call methods and access properties simply:

More at:

https://grokonez.com/kotlin/kotlin-singleton-object-declaration

Kotlin Singleton with Object Declaration
React props & others
Published: 2021-05-07 16:13:24

Hi, Dear Dev Community
Greetings!

There are several different ways to specify props in JSX.

# String Literals
<MyComponent message="hello world" />
<MyComponent message={'hello world'} />
The above two JSX expressions are equivalent.

# If you pass no value for a prop, it defaults to true.
<MyTextBox autocomplete />
<MyTextBox autocomplete={true} />
The above two JSX expressions are equivalent.

# If you already have props as an object, and you want to pass it in JSX, you can use ... as a “spread” operator to pass the whole props object.
function AppOne() {
  return <Greeting firstName="John" lastName="Hector" />;
}
function AppTwo() {
  const props = {firstName: 'John', lastName: 'Hector'};
  return <Greeting {...props} />;
}
The above two JSX expressions are equivalent.

# Children in JSX
In JSX expressions that contain both an opening tag and a closing tag, the content between those tags is passed as a special prop: props.children. There are several different ways to pass children:

<NewComponent>Hello world!</NewComponent>

This is valid JSX, and props.children in MyComponent will simply be the string "Hello world!".
JSX removes whitespace at the beginning and ending of a line. It also removes blank lines.

# You can pass any JavaScript expression as children, by enclosing it within {}.

<MyComponent>foo</MyComponent>
<MyComponent>{'foo'}</MyComponent>

The above two JSX expressions are equivalent.

# False, null, undefined, and true are valid children. They simply don’t render. These JSX expressions will all render to the same thing:

<div />

<div></div>

<div>{false}</div>

<div>{null}</div>

<div>{undefined}</div>

<div>{true}</div>