teleren/devto huggingface dataset:
Hugo Shortcode to Render HTML
Published: 2021-07-14 20:27:34

## Problem

Adding raw HTML in `hugo` content doesn't render at all in static page.

## Solution

Add a `shortcode` in layout folder to handle HTML in a safe manner.

```HTML
<!-- renderhtml.html -->
{{- $content := .Get "content" | default (.Get 0) -}}
<div>
    {{ $content | safeHTML }}
</div>
```

Now it can be included in any mardown content file as, Just put the raw HTML in between the ticks.

```txt
{{ < renderhtml `<div></div>` >}}
```
Learning another stack from nodeJs
Tags: node, csharp, webdev
Published: 2021-07-14 20:05:19

Hi. I have a question. Since 1 year, i been learning the mevn (mongo, express, node, vue), sql and js. I used this year to learn basics of servers, db's and front end framework vue, and getting enough pretty familiar with it.

Even if 1 year making projects for personal use is not enough,i am wondering if is a good ideea to transition to asp.net - c#. 

Even if might or might not be a full transition  to .net, what is your oppinion as experienced devs. 

Please elaborate
Currently on a 6 month contract for my first Dev job.
Published: 2021-07-14 20:00:04

I'm about 3 months into my first 'contract' job. Feeling all sorts of things lol. Wondering what I should expect moving forward. I'm having to ask for help often - but I've heard that's normal for a Jr. Dev. Long term I'd love to get that full-time (W2) job with this company.
React Preview - Instant, live preview of components in VS Code
Tags: react, javascript, webdev, productivity
Published: 2021-07-14 19:53:56

{% youtube S9IEC9GcoAg %}

Hi everyone!

I've been working on React Preview for a few months. It's currently only available for Visual Studio Code, but an IntelliJ/WebStorm and CLI versions are also in the works and coming soon (you can subscribe to be notified [here](https://signup.reactpreview.com)).

The plan is for React Preview to be a freemium product. The current features are all free, with more advanced paid features coming soon (e.g. integration with Storybook, mosaic of all your components, preview in multiple viewports, etc).

Install it here ➡️➡️➡️ https://marketplace.visualstudio.com/items?itemName=zenclabs.reactpreview

Please don't hesitate to send through bug reports [on GitHub] (https://github.com/zenclabs/reactpreview/issues) and let me know what you think in the comments!
Advise me! Just about to start learning Javascript
Published: 2021-07-14 19:41:15

Hello dev community!
I just finished learning html, css, git, and bootstrap, and now I want to expand my frontend web development skills by diving into JavaScript. As a beginner, what are some of the best resources that I can use to learn Js?
Also, what are a must-to-know concepts of Js that I need to master to be able to land my first job as a frontend developer?
Note: I'm aiming at mastering vanilla Js before diving into js frameworks and libraries.
I built a new website to help developers. It's small now but will have hundreds of tools, resources and more... Check it out!
Published: 2021-07-14 19:10:12

Hi everyone! Thanks for stopping by. I'm really excited to show you my new website. I've been pumping out work lately and I'm loving my productivity. 

## TL;DR
My new site. [https://coder.exchange](coder.exchange)


## The Details
I wrote back how I was struggling with perfection and imposter syndrome. You can read about it here [25 years of coding, and I'm just beginning](https://dev.to/dechamp/25-years-of-coding-and-im-just-beginning-442n).

So I've been busy last year or so working on just releasing my projects. No more making it "Perfect" because there is literally no such thing. 

I found myself still doing the "One more thing and then I'll release..." x 1000 lol. I just keep wanting to add more and more. 

The venture I've been on is about learning about myself, my hangups and my awesome abilities.

So I've release two site within just a little over a month. Pretty damn happy about that. 
- [coder.exchange](https://coder.exchange)
- [charactergenerator4000.com](https://cg4000.com)

Please let me know your thoughts. Got a tool you wanna add? I'm hoping this becomes a community thing where everyone starts to join and wants to be part of it! 

I have a lot of ideas for it so feel free to message me if you wanna be part of it. :)

Ideas to expand the coder.exchange...

### Current Todo
- Profiles
  - personal settings
    - tool positioning
    - light/dark theme
- Tools
  - ability to pass data between tools
  - share capabilities
  - easy way to allow users to add their own
  - ability to add tools to community
  - tool selection (hide/show)
  - state of tools (keeps history)
- Resources
  - community provided
  - ability to vote on usefulness
  - ability to mark as useless resource
  - commenting
- Chat
- many more... 


### Tool on there way
- timestamp
- stopwatch
- timer (count down)
- white noise (already done, just have to tweak)
- file sharing
- screenshot tool
- meditation/break/mental health tools
  - guided meditation
  - visuals for relaxing
  - docs/videos/resources on mental health



Thank you for your time! 

~DeChamp

## Request

Can you pretty please go to my sites and actually use them? I suck as SEO and I've never been able to get traffic to any of my creations much more than a few visits. It would mean a lot to me! Thanks in advanced! 


## Other Post
|----------|
| [My new CG4000 site](https://dev.to/dechamp/it-s-been-a-while-check-out-my-new-project-3p47) |
| [I would love feedback on my TypeScript skills and NPM Module.](https://dev.to/dechamp/i-would-love-feedback-on-my-typescript-skills-and-npm-module-5goc) |
| [Clean up your code with these tips!](https://dev.to/dechamp/clean-up-your-code-with-these-tips-4p5f) |
Where are GitLab CI templates
Tags: gitlab, terraform
Published: 2021-07-14 19:05:30

If you try to follow [GitLab's guide](https://docs.gitlab.com/ee/user/infrastructure/)  about Terraform you can be pretty confused by part of `.gitlab-ci.yml`:
```yml
include:
  - template: Terraform.gitlab-ci.yml

...
```

which seems to be doing most of the work in the example. Great that there is some way of having configuration templates, and great that they provided one for Terraform set up. The problem is that in the current state of the doc, it's pretty counter-intuitive to find the location of the files that we are including inside our configuration.

The files we are interested in are:
*  [Terraform.gitlab-ci.yml](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml) - the file we reference, and which imports:
* [Terraform/Base.latest.gitlab-ci.yml](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml)

I hope it will help some of you - I was really relieved to find those, and it removed one of the obstacles I had for getting Terraform managed deployment up & running in GitLab.
Creating a hash map based on the non zero values within a struct in Go
Tags: go
Published: 2021-07-14 19:00:04

I recently had a requirement to generate SQL queries based on the non zero values within a known struct.

It's common to duplicate structs to separates areas of your code (e.g your database struct may use types from the sql package, web struct may use pointers to avoid the zero value. We wouldn't want our 'core' struct to know about this). This works well for a lot of use cases, but gets unwieldy quickly.

This could also be done via reflect. Reflect is often avoided, and for good reason! It could be a foot gun if not used correctly as it panics on most errors and sometimes has questionable performance.

I have written [partial](https://github.com/lewisreay/partial) which returns the non zero values in a struct, based on the field tag. The field tag is required, and supplying an unknown tag will return an empty map. This functionality exists due to me wanting to select fields that only have the 'db' tag and may become optional in the future.
Stop using Dotenv in your front-end
Tags: react, webdev, dotenv
Published: 2021-07-14 18:51:24

[Dotenv](https://www.npmjs.com/package/dotenv) is wonderful. It allows you to use environment variables in your code, hence separating the code from its running environment.

The problem I have with it is that it is common to see people using it in the front-end of their web application (served static files, non-SSR applications).

## What is wrong with this?

Your environment becomes hard-coded in your files at build time. If you proceed this way, you need to build your application every time you wish to deploy it.

## Alternative

Load your configuration at runtime, either from a backend or from a configuration file (with an hash in the name). This way, your CI and your CD become 2 independent components. You build only once as opposed to once per deployment. Furthermore, the same artifact is being deployed everywhere, saving you a couple build minutes, and increasing your confidence in what you are deploying.

### Implementation example (configuration file)

In your `index.html` file, add a setting file that contains your environment variables:

```html
<script src="./settings/settings.js"></script>
// must be placed before your js files
```

File content example:

```js
var environment = {
  "backendBaseUrl": "http://localhost:8000",
}
```

Using Typescript? Type it:

```ts
type Environment = {
  backendBaseUrl: string
}

declare global {
  const environment: Environment
}
```

Then use it:

```js
const url = `${environment.backendBaseUrl}/potato`
```

Your deployment pipeline simply needs to ensure this file is being generated/deployed, which is way faster than building your whole codebase.
Welcome Thread - v133
Tags: welcome
Published: 2021-07-14 18:39:52

---
title: Welcome Thread - v133
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![Animated valentine that says "hi, how are you?"](https://media.giphy.com/media/4btN49Z3G4r6dcP6Y8/giphy.gif)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
The most common myths about anonymity on the Internet

Tags: tor, darkweb, anonymous, privacy
Published: 2021-07-14 18:36:15


Browser and its TOR network

It is considered a good tool for anonymity.

When using this network and the browser, encrypted traffic passes through a chain of proxy servers that are independent of each other. It changes regularly and new proxies are used. Many people think that identifying the user and his data is unrealistic.

But this is not the case. First, the last server sees the traffic in an unencrypted form. Secondly, the hardware of the computer, Canvas Fingerprint and other things are monitored. So yes, Thor enhances anonymity, but it is not a panacea.

The next misconception is that the history of my requests is stored only by my browser and I can easily delete it.

No, any search engine stores and remembers your queries. Has it ever happened that you google some product, and then you are haunted by its advertising? This is it. Google remembered what you were looking for and took advantage of it.

The third myth is that I will turn on the proxy and be anonymous.

First, the ISP sees that you are connecting to a specific proxy server. Therefore, if you are interested, it will not be difficult to track you. And if you don't connect, the provider will initially know and store your entire history of page visits, even if you later delete it from your computer.

Fourth myth. Do you think that if you do not indicate your real name and surname on the Internet, no one will get to them? The answer is no.

For example, many services now require a mobile phone number. And already on it it is not difficult to track you. You will say that the SIM is not registered in your name.

But your phone number is kept in the contacts of your friends, acquaintances and relatives. Some of them have you signed by name and surname. Mom has you signed as "Son". And at least one of your contacts has a phone book synchronization with Google. Do you understand the connection?

Well, the fifth myth is that if you turn off the geolocation in the smartphone, then they will not be able to track my location.

First, you can still be tracked by your phone number with your mobile operator.
Secondly, you can be easily tracked over the Wi-Fi network to which you connect.
Well, and so on) In general, using a smartphone, you can forget about complete anonymity, unless you turn off all the functions there that make it a smartphone.

Such things, guys. So be careful on the Internet.

__Do you want to Kick-start a career in Cyber Security and want to know how hackers hack in real life ☠️☠️__

Join Now and support  !!!
275+ Members already Joined

https://t.me/infosecbugbounty

Have doubts in your mind hackers ?ask your doubts related to cybersecurity Now !!!!!!
https://discourse.heeraj.com/
Writing an Assembler in Rust, and Why the Build Keeps Failing
Tags: rust, assemblers
Published: 2021-07-14 18:27:17

First off, I feel like the second part of the title is something pretty much every developer has experienced at one point. Second, obligatory GitHub repository plug:

{% github AshtonSnapp/chasm %}

Did a few things since last post. First, I set up a GitHub actions workflow that will build and test the project every time someone commits. Right now, I'm the only person working on this. Sadly. Second, I've implemented a variant for instructions and an enum that contains _literally every single instruction in the architecture_, all 51 of them, and four different callback functions for determining what instruction a token is. 

Then I had to give directives higher priority because `logos` was getting confused, and I also made roughly _too many_ regexps for addresses and immediates because of how callbacks work, and also because the architecture has 7 different addressing modes and I want to allow decimal, hexadecimal, and binary numbers for both addresses and immediates. 7 addressing modes plus two sizes for immediates, multiplied by 3 bases, means 27 regexps for addresses and immediates alone. I haven't even made the callbacks yet, which all those will do is make sure it's a valid number.

And now, I have an interesting... _problem_ whenever I try to compile the program. This issue only popped up recently, after the previous post, meaning something changed for some god dang reason, and now I'm getting `E0277: the size for values of type [u8] cannot be known at compilation time`, and the error is pointing out the logos derive bit, followed by a line inside `logos::lexer::Lexer`. Why is this happening? I have no idea what I did that caused this, but whatever it was happened some time between the last post and this one!

Honestly, at this point, I should probably go over to the logos repository and make an issue because I have no idea what caused this or how to fix it. Well, until next time, have an awesome day. Because I most certainly am not having an awesome day.
Adding a year worth of sprints in Azure DevOps with PowerShell
Tags: powershell, devops
Published: 2021-07-26 05:42:48

---
title: Adding a year worth of sprints in Azure DevOps with PowerShell
published: true
date: 2021-07-14 18:17:32 UTC
tags: PowerShell,DevOps
canonical_url: https://www.robstr.dev/adding-a-year-worth-of-sprints-in-azure-devops/
---

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

If you are working with Azure DevOps to keep track of your projects, you probably have to deal with sprints. Depending on the length of your sprints, and the fact that you can bulk add sprints, you probably either end up creating the next sprint during sprint planning or create every sprint manually.

Obviously, we hate manual tasks, so this is something we need to fix. Especially since our team is using one week sprints, and I don't want to do anything 52 times. When you read through the following script, make sure to adjust accordingly to fit your sprint length.

First, we need the VSTeam module. You can install it from [PowerShellGallery](https://www.powershellgallery.com/packages/VSTeam/) by running the following:

```
Install-Module -Name VSTeam
```

Next you would need to add your personal access token to your session, so you can actually add the sprints. You can create a personal access token by  clicking the avatar with the cogwheel on in the right corner of Azure DevOps, and chose the menu option personal access tokens.

```
Set-VSTeamAccount -Account 'Organization Name' -PersonalAccessToken 'Token'
```

Then, we do all the magic stuff. We create a loop, which starts on the first Monday of the year and continues throughout the entire year.

```
# Add the first date that we want the loop to start at.
# For the year of 2021, the first week would start on
# Monday the 4th
$date = Get-Date -Year 2021 -Month 1 -Day 4

while ($date.Year -ne "2022") {
    # Set date for the end of the sprint,
    # in this case a five day work week.
    $EndDate = $date.AddDays(4)
    if ($EndDate.Year -eq "2022") {
        # For the last sprint, so that it ends on the last day
        # of the year, not into next year.
        $EndDate = Get-Date -Year 2021 -Month 12 -Day 31
    }
    # Using Unix format, we can easily get the week number:
    $week = Get-Date $date -UFormat "%V"

    # Putting it all together, and adding the next sprint.
    # Notice that the name is using the week variable
    # in the format that our team uses.
    $Sprint = @{
        Name = "2021-W$week"
        ProjectName = 'ProjectName'
        StartDate = $date
        FinishDate = $EndDate
    }
    Add-VSTeamIteration @Sprint
    
    # bump the date we are working on with a week
    $date = $date.AddDays(7)
}
```

Like I mentioned, this creates the 52 weekly sprints for the year 2021. If you need to, you could set the end date to add 9 days instead of 4 so that you get two weeks, and then you would need to bump the date at the end by 14.
Horizontal scaling Vs vertical scaling
Tags: architecture, beginners, distributedsystems, cloud
Published: 2021-07-14 18:12:19

Hello Devs, in this article I'll walk you through the differences between horizontal and vertical scaling.

#What is scaling?

Let's say, you have developed an application and it is gradually getting traction. The user base is growing and the users are loving your app. Great!

The user base has grownup to a point where your system can't handle that much load. Not so cool. You don't want to disappoint your users, do you? You'll probably try to upgrade your system so that it can handle heavy load. You have two options:

1. Buying more machines
2. Buying a bigger machine

There you have it. Scaling may be defined as the process upgrading your existing system to handle more load.

##Horizontal scaling:
It is the process of buying more machines.

_Hmm.. if we have more than one machine, how do we make sure that the load is spread equally among the machines?_ That's where load balancers come into play. Load balancers make sure that the traffic is distributed equally among the servers.

###Advantages:

* Since we can buy as many machines as we want, we can say that horizontal scale scales well as the users increase.

* Even if one of the servers goes down, other working servers can handle the request. Hence it is resilient.

###Disadvantages:

* Load balancing is required.

* Servers communicate with eachother through network calls.

* As we use more than one machine, it may lead to data inconsistency.


##Vertical scaling:
It is the process of buying a bigger machine.


###Advantages:

* Load balancer is not required.

* We use only one machine, hence the data is consistent.

* The communication happens through interprocess communication, no network calls needed.

###Disadvantages:

* Single point of failure. Since we have only one machine, if it goes down the entire system will stop working.

* Eventually we will reach the hardware limit.

Thanks for reading! I hope this article helped you. Want to connect with me? my DM is open on dev.to, you can connect with me on [twitter](https://twitter.com/SaranChakravar3).
What if we want to be friends ?
Published: 2021-07-14 18:02:15

Throughout my coding journey, when learning something new, I always wondered how something I am learning now as a new software engineer has implications on what I already know as someone who has been on the internet practically my whole life. It blew my mind to be able think that I understand where something that I couldn't even fathom a few months ago, I can now see how different websites accomplish their goals.

Now, currently learning and working with creating my own back-end databases, a conversation with a friend on the matter led me to ask myself: "Now that I'm working with databases, do I know how social media giants such as Facebook and Twitter work ? How do databases of hundreds of millions of users keep track of who is friends with who ?"

Just these past few weeks I have starting about relational databases and the kinds of relationships different table of information have with one another. Usually by having a table of one kind of Data, for example "grocery items" and another table with a different kind of data, for example "customers" joined with a third kind of table that "joins" two different kinds of "Class instances" and creates a "many to many" relationship. See figure below.


![many to many](https://i.ibb.co/PhPWrfp/aww-board.png)

Each "order" belongs to a "grocery item" and to a "customer" while each "customer" has many "orders" and through "orders" has many "grocery items" and similarly, each "grocery item" has many "orders" it can be in, and through the many "order" has many "customers" as well.

This naturally brought up the question for me, what if I want to be friends with a human, and not a Jicama ? Do we need a second table of humans, just for me to be friends with them ? Would they be anti-humans ? Food for thought.

Thankfully we can have something completely different !

Using ActiveRecord, we can make a join table model that joins two instances of the same class, allowing for human-to-human friendships in this case. The power behind this is obvious as  it creates the opportunity to create relationships between two instances of the same class, without much issue. 

The domain model would look something like this:

![self-join](https://i.ibb.co/cX0mvMq/aww-board-3.png)

Here we have a model where a "friendship" belongs to two instances of "human" and each "human" has many "friendships" and through them has many other "humans". The syntax for setting this kind of relationship is a little different than usual, and has some nuances depending on the kind of relationship between to "humans" that will be the subject of future posts. This just serves to provide some insight into what is possible and some food for thought.

Happy databasing.