teleren/devto huggingface dataset:
State Management with Vuex: a Practical Tutorial
Tags: vue, vuex, javascript, statemanagement
Published: 2018-11-13 17:02:03

---
title: State Management with Vuex: a Practical Tutorial
published: true
description: Learn, through a practical tutorial, how to use Vuex to manage the state of your Vue.js apps the right way.
tags: #vuejs #vuex #javascript #statemanagement
canonical_url: https://auth0.com/blog/state-management-with-vuex-a-practical-tutorial/
---

As Single-Page Applications (SPAs) are fast becoming the de-facto way of developing frontend applications, one of the major issues that developers are facing is how they manage state between all the components spread around their applications. Vuejs apps are not an exception to this. To solve this problem, you will learn, through a practical guide, how to use Vuex to manage the state of your Vue.js apps with ease.

[Read on 🎢](https://auth0.com/blog/state-management-with-vuex-a-practical-tutorial/?utm_source=dev&utm_medium=sc&utm_campaign=vuex_tutorial)

![State Management with Vuex: a Practical Tutorial](https://thepracticaldev.s3.amazonaws.com/i/rdez5onabcjao5n08yh0.png)
Analytics will be generally available soon
Tags: meta
Published: 2018-11-13 16:42:25

When everything is `!important`, nothing is `!important`. We've been delayed at making post analytics generally available, but we're finally ready to buckle down and iron out the issues and ship non-buggy (hopefully) analytics for all.

Feel free to comment any thoughts on this feature that we should take into consideration.

Also I think night mode is coming. [This PR looks promising](https://github.com/thepracticaldev/dev.to/pull/1104).
Stimulus is simple
Tags: javascript, rails
Published: 2018-11-13 15:51:15

Really enjoying returning to my roots. I'm currently enjoying rails, webpacker, and simulus. (I didn't forget about you, turbolinks or ujs!)

Just look how simple this is. Reminds me of knockout. Why did I ever think knockout was ugly?

![simple edit-in-place post title](https://pbs.twimg.com/media/Dr5MG4RUUAAl29S.png:large)
How to profile CPU and memory usage from Android C# app while debugging?
Tags: profiling, csharp, android
Published: 2018-11-13 15:47:51

I need to make a performance profile of a C # Android application to optimize some processes.
After doing some research on Google, I know that Microsoft Visual Studio has performance profiling features in the Enterprise Edition, and unfortunately, I only have Professional and Community Edition available.

I'd like to know where my code is less performative to optimize.
TIL: Pitfall on getting all environment variables in Go
Tags: go
Published: 2018-11-13 15:24:58

---
title: TIL: Pitfall on getting all environment variables in Go
published: true
description: 
tags: Go
---

Hello, this is my first post at DEV.TO 🐶

To get the list of all environment variables in Go, I found a function to do that in standard libraries

- [`os.Environ()`](https://golang.org/pkg/os/#Environ)

> Environ returns a copy of strings representing the environment, in the form "key=value".

Using this function, I tried to write a function to get all environment variables key-value pairs in `map[string]string`.

## Bad example 😣

I at first wrote following code.

```go
kv := os.Environ()
m := make(map[string]string, len(kv))
for _, s := range kv {
    if idx := strings.IndexRune(s, '='); idx >= 0 {
        m[s[:idx]] = s[idx+1:]
    }
}

// `m` is what I wanted!
```

This example looked working fine at first, however later I found in some case it did not work only on Windows.

I found that the `m` contains empty string key `""` and checked the output from `os.Environ()` line by line. And finally I found the cause.

```
=C:=C:\path\to\current\dir
```

What's this? But environment variable `$=C:` was actually existing on system. It was a hidden environment variable not listed in output of `set` command.

I dug Go standard library and found a comment (thank you @mattn for helping me to find out this!).

https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/syscall/env_windows.go#L58-L60

> Environment variables can begin with =
> so start looking for the separator = at j=1.
> https://blogs.msdn.com/b/oldnewthing/archive/2010/05/06/10008132.aspx

The post in the comment, [What are these strange =C: environment variables?](https://blogs.msdn.com/b/oldnewthing/archive/2010/05/06/10008132.aspx) explained what `$=C:` is.

> Okay, so the command processor sets these things, but what are they? They are a leftover from the command processor's attempt to mimic the old MS-DOS way that drives and directories were handled. Whereas in Win32, there is only one current directory, in MS-DOS, there was one current directory for each drive.

So this is a hidden special environment variable on Windows and I need to consider it on getting all environment variables.

## Good example 😆

Fortunately, fix was easy. `=` is at first character, and environment variable name is never empty. So we can simply ignore the first character.


```go
kv := os.Environ()
m := make(map[string]string, len(kv))
for _, s := range kv {
	// On Windows, environment variable names may start with '=' (e.g. =C:).
	// To handle the variables properly, skip first character of KEY=VALUE line.
	for i := 1; i < len(s); i++ {
		if s[i] == '=' {
			m[s[:i]] = s[i+1:]
			break
		}
	}
}

// `m` is what I wanted!
```
Episode 7: Building a JSON API - Paging
Tags: node, mongodb, javascript, docker
Published: 2018-11-13 15:11:35

---
title: Episode 7: Building a JSON API - Paging
published: true
description: Episode 7 covers adding pagination to existing routes, and slightly updating their models.
tags: nodejs, mongodb, javascript, docker
series: building-a-json-api-with-express
cover_image: https://thepracticaldev.s3.amazonaws.com/i/gzgnucx3ysscgkzwrzzz.png
---

{% youtube Qnqn_L5NLSg %} 

This one runs a bit longer than normal, sorry about that.


Source:

{% github nathanbland/core %}
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2018-11-13 14:46:55

---
title: Top 5 DEV Comments from the Past Week
published: true
description: Highlighting some of the best DEV comments from the past week.
tags: bestofdev
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--7VrAA2ln--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/qmb5wkoeywj06pd7p8ku.png
---

This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag.

@dan_abramov jumped into the **[Why the React community is missing the point about Web Components](https://dev.to/ben/why-the-react-community-is-missing-the-point-about-web-components-1ic3)** to offer his perspective.  The original post, along with the full discussion is well worth your time:

{% devcomment 6kdc %}

@ben takes home the brevity award this week with his answer in Ali's **[Daily Coding Puzzles - Nov 4th - Nov 9th](https://dev.to/aspittel/daily-coding-puzzles---nov-4th---nov-9th-5bfa)** thread.  "Your goal is to implement a difference function, which subtracts one list from another and returns the result.":

{% devcomment 6lk2 %}

In a conversation centered around taking meaningful time off — **[If it's Saturday and you won't be coding again until Monday, how do you get your mind off your current work?](https://dev.to/ben/if-its-saturday-and-you-wont-be-coding-again-until-monday-how-do-you-get-your-mind-off-your-current-work-n6c)** — @bennypowers hops in with a great answer:

{% devcomment 6m4g %}

The entire **[Things Nobody Told Me About Being a Software Engineer](https://dev.to/anaulin/things-nobody-told-me-about-being-a-software-engineer-3pa5)** thread is a great launch-point and discussion for tons of non-obvious realities of being a software engineer.  @shiling takes the top spot:

{% devcomment 6lcg %}

**[It's good to identify what you don't need to bother learning](https://dev.to/ben/its-good-to-identify-what-you-dont-need-to-bother-learning-1nm6)**.  @shalvah captures the spirit of that thread with this concise take-away:

{% devcomment 6l87 %}

See you next week for more great comments ✌
How do you structure a Saas domain?
Tags: help, webdev, discuss
Published: 2018-11-13 14:30:37

---
title: How do you structure a Saas domain?
published: true
description: Help needed
tags: help, webdev, discuss
---

#How do you structure a Saas domain?

Help needed!

I am in the sake of building a saas MVP, the indie way. Since I am just learning to code, I have a lot of questions beginning with how to structure the domain. 

I want to use Wordpress to start blogging asap while constructing de MVP in order to get noticed for search engines and get traction as fast as possible. Yes I know Hugo, Jekyll, Gatsby etc... are there but I know Wordpress pretty well, and I have other learning priorities.

I also want to take feedback for potential users while building the product.

Should I make...?

 - The home "saas.com" a pure html/css landing page for very fast loading.
 - A subfoolder like "saas.com/blog" for a wordpress installation.
 - A subdomain "app.saas.com" for the web application itself.

In addition to that, I plan to host the blog in a managed hosting service (too little time and knowledge to run it in a self managed hosting, just for security reasons) and the app perhaps in Heroku at initial stage.

**What path do you recommend me to follow? What do you think is best for SEO?**

Thanks for your comments and suggestions.
Unavoidable Notification
Tags: meta, notifications
Published: 2018-11-13 14:18:05

I'm having an interesting issue with dev.to lately where I have a notification badge stating I have a new message, however when I go to check my messages, nothing is new.

Here's a screenshot of my having a notification:

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

And here's my chat when I click on the paper airplane. You can see that the unread badge is gone, but there're no new messages:

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

After I go back to the home page, the unread notification is still present.

Is this only something on my end or is this a known issue?

_2018/11/27 EDIT: I've since posted an issue on GitHub about this following the discussion with Ben in the comments: https://github.com/thepracticaldev/dev.to/issues/1210_
Working on legacy code should not be a grief
Tags: legacy, tests, craftsmanship
Published: 2018-11-13 14:00:07

---
title: Working on legacy code should not be a grief
published: true
description: Working on legacy code is a real challenge, how can we deal with it?
tags: legacy, tests, craftsmanship
---
Working on legacy software is difficult. We've all faced this issue in our career, and that's why there are so many books about working with legacy code, improving an existing code base using unit tests and clean code principles...

The lack of tests implies that code is hard to understand, hard to test, long to deliver and costly to support because of bugs that will inevitably happen in production.

For too many teams, testing legacy code leads to the same 5 phases as those of grief and loss:
- denial: "we don't need automated tests, we can still maintain our product, we know how it works"
- anger: "there was still an incident after our delivery! this product is s**t, we should rewrite it from scratch"
- bargaining: "ok, we could write some tests for new features. Let's try this for the next release"
- depression: "our code is not easily testable, the release is late because it takes too much time to write tests, and moreover they are fragile, there is nothing we can do"
- acceptation: "let's hire more people for support, this will help us since we can't add automated tests. We'll also release less often so that we can plan non regression testing phase"

Sure, testing a legacy monolith is not an easy task, even for experienced and cautious developers. In fact, testing spaghetti code is almost guaranteed to lead to poor tests, very coupled with implementation details, and every change will break them.

That's why it is important to improve the code step by step, with small refactorings that are unlikely to break existing behaviors, starting from very small steps and going on with more complex ones as the code improves:
- rename variables, methods or classes so that their purpose is clearly expressed and easier to understand
- remove unused or dead code
- testing a long method or class is difficult, so break them into smaller pieces. By simply extracting them using your IDE's refactoring capabilities, you shouldn't break anything. The code will become easier to tests, since the dependencies and the responsibility of each block will be reduced.
- once you start to have a comfortable tests harness, you can start performing more deeper refactorings (using abstractions instead of concrete implementations to favor testability and evolutiveness, using design patterns...)

Don't forget the importance of team work during these difficult times. If you can't solve a problem alone, pair programming or even mob programming will help you and your pairs. This will ensure that every developer of the team will know how to face similar problems when they'll want to improve another piece of code.

During the challenging tasks, clean code principles, SOLID principles and all the usual craftsmanship toolkit will help you, so be sure to understand them and to be able to apply them when necessary !
Good Posts and Videos about Ruby/Rails and Node on Planet
Tags: ruby, node, rails, chengefavor
Published: 2018-11-13 07:01:12

---
title: Good Posts and Videos about Ruby/Rails and Node on Planet
published: true
description: 
tags: ruby, node, rails, chengefavor
---

# Ruby

**Posts**

{% link bhserna/a-simple-way-to-organize-your-app-in-use-cases-3h9e %}

{% link edisonywh/ruby-has-no-class-methods-39l5 %}

{% link chenge/a-good-pic-for-learning-ruby-5l4 %}


**Videos**

[The Case Of The Missing Method - A Ruby Mystery Story](http://www.nadiaodunayo.com/speaking/the-case-of-the-missing-method-a-ruby-mystery-story)

# Node

**Posts**

{% link bgadrian/advanced-javascript-panel-talks-4b5o %}

{% link https://dev.to/waqardm/learning-resources-for-dev-newbies-52e %}


**Videos**

[What is Event Loop？ | JSConf 2014](https://www.youtube.com/watch?v=8aGhZQkoFbQ)

Invent a great tool loupe to watch Node.

[Node.js Tutorial for Beginners: Learn Node in 1 Hour | Mosh
](https://www.youtube.com/watch?v=TlB_eWDSMt4)

# End

Feel free to leave a comment to share your favor please. This is the strength of Community.

If you like this I'll add posts about Go, Rust, Elixir, Clojure, Linux...
Bert & Pinal Troubleshoot a Slow Performing SQL Server
Tags: sql, performance, sqlserver
Published: 2018-11-14 11:46:48

---
title: Bert & Pinal Troubleshoot a Slow Performing SQL Server
published: true
tags: SQL,Performance,SQLServer
canonical_url: https://bertwagner.com/2018/11/13/bert-pinal-troubleshoot-a-slow-performing-sql-server/ 
---
{% youtube K7o3SUhvgFs %}


What happens when you run into performance tuning expert [Pinal Dave](https://blog.sqlauthority.com/)?  Talk about how to troubleshoot a slow performing SQL Server of course!

This week is all about the video, so if you can’t view it above, [head on over to my YouTube channel to watch it there](https://youtu.be/K7o3SUhvgFs).

After watching, be sure to check out Pinal’s free performance diagnostic scripts over at SQLAuthority.com:

- [Replacement for DBCC INPUTBUFFER: sys.dm\_exec\_input\_buffer](https://blog.sqlauthority.com/2016/12/04/dmv-replace-dbcc-inputbuffer-command-interview-question-week-100/)   
- [Finding the longest running queries](https://blog.sqlauthority.com/2016/11/20/find-longest-running-query-execution-plan-interview-question-week-098/).  
- [Introduction to wait statistics](https://blog.sqlauthority.com/2011/02/01/sql-server-introduction-to-wait-stats-and-wait-types-wait-type-day-1-of-28/)  

_Thanks for reading. You might also enjoy [following me on Twitter.](https://twitter.com/bertwagner)_
Enmeti 1.2.1 Update Log
Tags: vscode, update, node, markdown
Published: 2018-11-13 11:19:48

---
title: Enmeti 1.2.1 Update Log
description: What's new with Enmeti since the 1.1.1 release.
cover_image: https://i.imgur.com/Flb2ike.png
tags: vscode, update, node, markdown
published: true
---

_Cover Image by [The Lonely Photographer][1] on [Unsplash][3]_

## Is It Done Yet?

Of course not! If you've ever written code for a project you enjoy working on, you know the work is never truly done. You're always in a state of changing things or coming up with new ideas.

Lately, I've been working on adding translations to the text used by [Enmeti][2] as well as learning more about how VSCode handles various display languages. At this point I've got a decent version of the extension working with support for English, Spanish, and French. Granted, the Spanish translations were done with Google Translate so there's no telling how accurate they are 😅

I've got a few friends that will be doing more accurate translations of the strings used and then I'll update the extension accordingly. For the time being, it's a start at least!

## Next Features

At this point I'm pretty happy with where it stands. I still have some work to do in regards to the translation support, and once that's complete I'll have finished everything on my original roadmap for Enmeti. I've got a few other ideas I'd like to add but I'll be taking a slower approach to pushing changes to the marketplace. After the last few releases I noticed glaring issues that I'd have caught if I only used the extension a bit more before publishing that version.

The next idea I have in mind is adding the ability to insert links to a **Referenced Links** section near the bottom of the file in case you want to show all the links referenced in one section. Ideally, it would add the link reference to the bottom of the file like normal, but just above those hidden references it would show a **Referenced Links** section that shows the URL's referenced throughout the file.

If you'd like to provide translations of the text into your own language, simply check out the [Strings.js][0] file and submit a PR with your additions. That said, if you have any comments, criticisms, or suggestions, please don't hesitate to let me know 😊

[0]: https://github.com/HF-Solutions/Enmeti/blob/master/tools/Strings.js
[1]: https://unsplash.com/photos/JgpHTeuqChw?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[2]: https://marketplace.visualstudio.com/items?itemName=hf-solutions-llc.enmeti
[3]: https://unsplash.com
Seed Table Storage
Tags: devops, azure, microservices
Published: 2018-11-13 10:46:51

---
title: Seed Table Storage
published: true
description: 
tags: #devops #azure #microservices
---

# Introduction

I wrote a few sentences about an Azure Cloud [here](https://dev.to/meanin/create-azure-storage-account-on-release-pipeline-4kn4). When you are deploying an application, sometimes you need some basics data already be placed in a database. Some prerequisites, without which an application will work in a wrong manner. Seeding and migrating SQL databases in a .net world is a well-described topic. If you know Entity Framework or Hibernate, you know where to start. What to do with this, when you want to store data in an Azure Table Storage?

# Install extension

To install this extension, you need an organization on Azure DevOps portal. You can start [here](https://azure.microsoft.com/en-us/services/devops/?nav=min). On this portal, you have to have rights to install extensions. Then navigate [here](https://marketplace.visualstudio.com/items?itemName=meanin.storage-account-managment).

# Configure task

![img](https://raw.githubusercontent.com/meanin/vsts-tasks/master/screenshots/seedtablestorage.png)

To use this task you have to have a [configured](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=vsts#sep-azure-rm) Azure Resource Manager connection with a Service Principal. Set a storage account name and a table name which you want to seed. Select a JSON file location. The file has to be a JArray of a flat object, which everyone contains at least two properties: PrimaryKey and RowKey.
Here is a little example:
```
[
    {
        "partitionKey": "partitionKey1",
        "rowKey": "1",
        "otherColumn": "value1",
        "fourthColumn": "123"
    },
    {
        "partitionKey": "partitionKey1",
        "rowKey": "2",
        "otherColumn": "value2",
        "fourthColumn": "123"
    },
    {
        "partitionKey": "partitionKey2",
        "rowKey": "1",
        "otherColumn": "value1"
    },
    {
        "partitionKey": "partitionKey2",
        "rowKey": "2",
        "otherColumn": "value1"
    }
]
```
After release, table with data looks like below:
![img](https://raw.githubusercontent.com/meanin/dev-to-articles/master/img/2018-mm-dd-seed-table-storage/seed-table.png)

This is the first published version of this task. I will appreciate all feedback :)
Daily coding exercises to build momentum?
Tags: learning, motivation, practice, discuss
Published: 2018-11-12 21:58:57

---
title: Daily coding exercises to build momentum?
published: true
description: Other than algorithms, Codewars, etc
tags: learning, motivation, practice, discuss    
---

Looking for suggestions for some "warm up" type coding tasks that are good for 20-60 minutes a day to practice just writing code. Not solving algorithmic arithmatic or CS problems, but actually building quick little widgets to keep me writing actual code. 

For me, kata-style practice is like waking up and doing 100 pushups then a 200m sprint before even brushing my teeth. Too much too soon and not conducive to the type of routine I want to build. What I need to do is develop the momentum to put me in a place where I know enough of the language (MERN stack in my case) to be able to focus on the meat of a problem without immediatly wanting to look at the solution because I can't think of how to actually write a solution.

I'm trying to come up with enough quick little projects to keep my fingers on the keys instead of just bookmarking articles I forget to read on dev.to. I'm not necessarily looking for larger projects like "Build a Trello Clone" or "Create a ToDo List", etc, because I have projects on the horizon I will be doing for class work. I just want to start small and simple.

How do you all keep your momentum and skills sharp when you're not in the middle of a project?
Do you know any good resource about mental health in the software industry?
Tags: discuss, opensource, mentalhealth, health
Published: 2018-11-13 10:18:25

---
title: Do you know any good resource about mental health in the software industry?
published: true
description: Let's make an awesome list about mental health in the software industry.
tags: discuss, opensource, mentalhealth, health
---

Hi folks!

I would like to start here a discussion in which we can all together contribute to make an awesome list with all kind of resources (articles, talks, podcasts, organizations...) about mental health in the software industry.

One month ago I made a repository for this purpose. The initial idea was motivated by this tweet of Jess Lee on the World Mental Health Day: https://twitter.com/jessleenyc/status/1050107830794096641, so I guess it makes sense to share here the repository I made and so we can create something nice among the whole community 😊

This is the Github repository: https://github.com/dreamingechoes/awesome-mental-health. Do you know any good resource? I'll appreciate so much if you leave it in a comment here, or if you want you can make a pull request in the repository.

Thank you! 🤗 💖
toastr in angular
Tags: angular
Published: 2018-11-13 09:35:40

---
title: toastr in angular
published: true
description: toastr in angular
tags: Angular
---
Hello to all, I am also doing this with Angular 7.

**Here you can check working example of toastr in Angular 7:** 

[toastr in angular](https://therichpost.com/angular-7-toastr-notifications-working-example)


Thank you
therichpost