teleren/devto huggingface dataset:
Create Specflow `feature.cs` At Build Time
Tags: dotnet, csharp, specflow, testing
Published: 2020-02-22 03:15:36

---
title: Create Specflow `feature.cs` At Build Time
published: true
date: 2019-04-30 00:00:00 UTC
tags: dotnet, csharp, specflow, testing
canonical_url: https://chrisotto.dev/change-specflow-build/
---

## Change Feature File to Generate the `~.feature.cs` at Compile Time

Whenever a new Specflow file is created in the solution it is automatically created with the SpecFlowSingleFileGenerator specification in the Custom Tool attribute. This file generator creates the background file on save instead of during the buildprocess, follow these steps to make the change:

### Prerequisite

To make the change you will need to add an extension to your instance of Visual Studio if you don’t have it already.

- In Visual Studio go to Extension Manage Extensions
- Select Online and search for ‘File Nesting’
- Install the ‘File Nesting’ extension and close Visual Studio, once closed the installation will begin
- When prompted after VS closes, select ‘Modify’ from the pop-up window

### Making the Change

With the ‘File Nesting’ extension installed we are now ready to change how the ~.feature.cs is created for our feature file.

- Modify the existing properties
  - In the Solution Explorer, R-Click on the feature file Select Properties
  - The Properties window should pop up below the Solution Explorer
  - In the Custom Tool attribute, delete ‘SpecFlowSingleFileGenerator’ leaving the Custom Tool attribute blank
- Creating the File dependency
  - With the Custom Tool removed, build the solution
  - Once built make sure that you have ‘Show All Files’ selected and you should see the ‘~.feature.cs’ file for your feature file in the Solution Explorer
    - If you don’t see it and you already had ‘Show All Files’ enabled, try refreshing the Solution Explorer and it should populate
  - R-Click on the `~.feature.cs` file Select ‘File Nesting’
  - Nest the file under the respective feature file
Git - Renaming A Branch Locally & Remote
Tags: git, remote, branch
Published: 2019-05-09 23:35:17

---
title: Git - Renaming A Branch Locally & Remote
published: true
tags: git, remote, branch,
canonical_url: https://stephencharlesweiss.com//2019-04-30/git-rename-branch-local-and-remote/
---

To rename the name of a branch, there are four potential steps:

1. Checkout the existing branch (the one you want to rename): `git checkout <old_name>`
2. Rename the local branch by moving it: `git branch -m <new_name>`
3. If you’ve already pushed the `<old_name>` branch to the remote repository delete the `<old_name>` remote branch: `git push origin --delete <old_name>`
4. Finally push the `<new_name>` local branch and reset the upstream branch: `git push origin -u <new_name>`

That’s it. At this point you have successfully renamed your local and remote Git branch.

# A note about the `-m` flag:

Similar to the `mv` command in Bash, the `-m` flag is for moving. Since you’re on a branch, Git infers the branch that’s being moved, however, you can be explicit and consolidate steps 1 and 2 with `git checkout -m <oldbranch> <newbranch>`.

# Additional Reading

- [How To Rename a Local and Remote Git Branch](https://linuxize.com/post/how-to-rename-local-and-remote-git-branch/)
- [10 insanely useful Git commands you wish existed – and their alternatives](https://dev.to/datreeio/10-insanely-useful-git-commands-you-wish-existed-and-their-alternatives-8e6)
Documentation automation
Tags: productivity, documentation, workflow, discuss
Published: 2019-04-29 22:54:12

---
title: Documentation automation
published: true
description: I want to know your experiences
tags: productivity, documentation, workflow, discuss
---

Hi people,

Due to a past post where several users recommended books about programming or more general bibliography (this is the post: https://dev.to/lightalloy/learning-to-love-software-development-books-5e4) I've read past week the book The Pragmatic Programmer.

I have to say, the book is plenty of interesting stuff and thing I will try to implement during this year. The most inmediate and time-gaining measure, I think, is when the book suggests to automate project documentation.

How?

1. Use a markup language for the documentation
2. Put it on version control software
3. Based on the markup language, generate scripts to the required outputs: HTML, PDF, EPUB or whatever you need

I think this is a great concept, and I will work on this in my organization for the next months. And I would like to read from you if you had any experiences with this and recommend tools, etc.

Saludos,
Array and Slice in Go 
Tags: go, array, slice
Published: 2019-04-29 22:18:35

---
title: Array and Slice in Go 
published: true
description:  The goal of the post is to explore array and slice in Go.
tags: go, array, slice
---

# Array

Array is a compound object with  fix length of object of the same type. For example in go;
##### go
```go
package main

import "fmt"

func main() {
    //This defines a variable that holds 4 integers
	var a [4]int = [4]int{1,2,3,3}
	//go array index value can be mutated unlike rust
	a[2] = 10
	b := [5]int{1,2,3,4,5}
	fmt.Println(a)
	fmt.Println(b)
	//If you try to assign array of length 5 to a, it errors
	//a := [5]int{7,8,9,10,11} //uncomment this
}
```

# Slice
A slice is a data type that is backed by an array but with mutable size. It  consists of a type and size basically pointing to a specific part of array, length of the array that the segment has and maximum capability of the underlying array starting from the the slice head. 
```go
package main

import "fmt"

func main() {
    arr := [4]int{1,2,3,4}
	s := arr[1:] //The defaults to arr[1:4] with last one excluded
	//You can also make slice using `make`
	m := make([]int,1,2) //The creates a slice with length 1 but capacity 2.
	fmt.Println(m)
	//Ok, lets just copy one slice to another. This only copies one element because of m length
	copy(m, arr[1:])
	fmt.Println(m)
	fmt.Println(s)
}
```
You can define a slice literal or go the route of using make function specifying the length as well as capacity as we have seen above.


### Null Slice
When you define a slice without setting a value, what you have is a null slice. There is no underlying array that is backing the slice. One thing that stands out with null slice is they can act like zero length slice which means you can treat them like a slice that you defined with zero length.
```go
package main

import "fmt"

func main() {
   //This slice defined below will be treated like an empty slice of type int
   var s []int
   fmt.Println(s)
   //Lets add some int to this null slice; Null because it does not have underlying array
   s = append(s,1,2,3,4)
   fmt.Println(s)
}
```
```bash
[]
[1 2 3 4]
```
You have to be careful with slice as they can hold large objects in memory hostage even if they refer to only a small part of the data.
Attended My First Dev Meetup
Tags: javascript, beginners, webdev, react
Published: 2019-04-29 21:24:58

---
title: Attended My First Dev Meetup
published: true
description: I went to React in 2019 held by RocDev. It was amazing.
tags: #javascript #beginner #webdev #react
---

As a newbie who just started teaching myself Javascript back in November, I haven't had any chance at all to interact with actual developers. I'm in a few learning to code groups on Facebook, a couple Slack and Discord channels, but most of my interactions have been sparse.

People are busy. I try to only ask questions when I really am at the end of my road (which is rare.) Or, share useful interesting things. 

I heard that meetups are really good for networking and also just learning from other devs in general. I live in Rochester NY, a small city, but was super excited to find [RocDev.org](https://rocdev.org/), who typically hosts two meetings per month. I was lucky to have the first one be on React, the very thing I've been practicing day in and day out. I signed up right away.

The host of the meeting, Josh Kramer, is a Senior Developer with Measures for Justice. He went over most of React's new features since 16.8 was released or that are coming up, such as the various hooks, React.lazy, Suspense, and React.memo. 

All in all, I learned a lot. He explained the way that hooks re-render, which was something I wasn't aware of through my studies. It also helped me figure out some of the weird quirks I've been noticing while building my current app. 

He was even nice enough to talk to me a few minutes afterward and answer some questions I had. Something I was very grateful for. 

I felt like a kid in a candy store, surrounded by these things I've been studying and pouring over day and night. I can't wait until the next one, which will be about Service Workers, something I haven't delved into. I bet I'll learn a ton there as well.

If your new to programming or React, I suggest trying to find yourself a Meetup. It's a great experience!
Rainy day, coffee and code...
Tags: lifestyle, discuss
Published: 2019-04-29 21:10:47

---
title: Rainy day, coffee and code...
published: true
description: Essence of coding...
tags: #lifestyle, #discuss 
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/xnfd3q55l1i8dpj9pa2x.jpg"> 


  For me, this is the best compliance. Of course, you can add some features like purring cat and favorite music. You can also replace coffee with cup of tea. However...
I'm wondering....
 What about you guys? Do you have something like this? Please share.


<a href="https://www.mixcloud.com/johnnyminthemix/surreal-world-progressive-house-set/">"Surreal World"</a>
I’m launching Plausible
Tags: showdev, news, analytics
Published: 2019-05-09 16:12:56

---
title: I’m launching Plausible
published: true
tags: showdev,news,analytics
canonical_url: 
---

It’s been 4 months since I wrote about [the analytics tool I want](https://dev.to/ukutaht/the-analytics-tool-i-want-1mhf-temp-slug-6505055). My idea was to create an alternative for Google Analytics that simplifies the UI and enhances the privacy of online tracking.

After writing that initial post, I spent 2 months creating a prototype and launched the public beta for [Plausible](https://plausible.io) in February.

By now, more than 60 people have signed up used Plausible successfully. I’ve received encouraging feedback and many feature requests over the last two months. I appreciate everyone’s feedback as it has helped me form the roadmap for the next few months of development.

I could easily hide in my cave for more months to tackle that roadmap. But to see if Plausible has real potential, I have to introduce it to the marketplace and see if people are actually willing to pay for it.

### Pricing

Coming up with the price tag for Plausible was a surprisingly difficult process. I started by asking myself: _Should Plausible have a freemium model?_After doing some research, I decided that the support and maintenance costs of running a free tier would be far too high for one person to handle. As a solo founder, I need to keep overhead low so I can keep up with both support and product development.

I’m not going to rule out a free tier or even a self-hosted version of Plausible in the future. However, I want to protect my time for now and get the product working well in the market before scaling up.

As a customer I appreciate products with very simple pricing schemes, so I wanted to keep it as straightforward as possible. There will be no premium features, accounts will be billed purely for the amount of traffic they get.

- up to 10k pageviews - **$6 / mo**
- up to 100k pageviews - **$12 / mo**
- up to 1m pageviews - **$36 / mo**

It was important for me to include a small (\<10k) tier to suit personal websites and blogs that don’t get much traffic. I will definitely be experimenting with these plans going forward to see what works best.

Existing beta users also get a third off on all of these plans. This is my way of thanking the beta community for providing feedback and engaging with the product from an early stage.

### Going forward

Plausible is still under heavy development. With the introduction of paid plans, I will be investing more into customer support and documentation as well.

The goal for the next month or so is to get payments, invoicing, and VAT handling all working smoothly. Once I have all the tools set up to run the business, I can shift focus back to product improvements.

I’m really excited about making Plausible the best web analytics tool out there. There’s a long way to go on this mission but today marks a big milestone on this journey. Check back on this blog for updates on the product and the business.
What framework do you use and why?
Tags: discuss, backend, node
Published: 2019-04-29 20:41:41

---
title: What framework do you use and why?
published: true
description: 
tags: discuss, backend, nodejs
---


I usually use Express.js or Restify.js for simplicity. But I'm wondering if it's better to use a more full-featured framework like Kraken.js or Sails.js, especially for larger projects.

I know it varies by use-case, but I'm curious to know why I don't see as many people in the node.js community embracing such full-featured frameworks; most devs that I've come across always recommend Express or Restify.
An Introvert's Guide to Thank You notes
Tags: introvert, guide
Published: 2019-04-29 20:25:44

---
title: An Introvert's Guide to Thank You notes
published: true
description: My template for writing thank you notes and emails.
tags: introvert, guide
---

It can feel a little old fashioned, but thank you notes are still appreciated in this digital world. I use thank you notes as a way to give thanks and remind others of our interaction.  I enjoy writing thank you emails because then I have a record of what we discussed.

{% link geekgalgroks/the-introverts-guide-to-tech-conferences-22nf %}

As per points 8 and 9 of my conference guide, I use thank you notes to keep in touch with those I chatted with.

My generic template is:
- greeting
- reminder of what we discussed
- any followup
- thanks

So as an email, it could look like:
```plaintext
To: Super Cool Person
Subject: Great seeing you at the conference

Body:
Hi Super!

I greatly enjoyed talking with you this weekend. I really liked discussing xyz and learning about abc that solves many of the problems I was having.

I look forward to having coffee with you the next time you are in town.

Thank you once again,

Jenn
```

I tend to be rather casual with my thank you notes, you can easily make it more formal if desired.
New to blogging
Tags: firstpost, new, freesubdomain
Published: 2019-07-08 15:58:51

---
title: New to blogging
published: true
tags: firstpost, new, freesubdomain
canonical_url: https://blog.ryan.devportfol.io/new-to-blogging/
description: Just a little about my background and what I'm working on.
---

I have written a handful of news stories for College publications and other blogs, however I have never run my own blog with the intent of sharing my experiences before.  Most of my previous content has been technology reviews, such as one on Phonebloks<sup>[1]</sup>.

<!--kg-card-begin: image-->

![Phonebloks concept image](https://blog.ryan.devportfol.io/content/images/2019/04/component.png)<figcaption>Phonebloks is an idea for a modular phone.</figcaption>

<!--kg-card-end: image-->

This blog is intended to be not only be a tie in with my [portfolio site](https://ryan.devportfol.io/), but also an avenue for me to share my journey as I work towards making DevPortfol.io a legitimate business.  With DevPortfol.io, I would like to create an end to end Development portfolio domain, hosting, and building platform.  So far I have acquired the domain name, I have my portfolio, GitLab, and this blog running on it, and working on fleshing out concepts for the main website and the builder.  

## What is currently available on DevPortfol.io?

For now, I am allowing people to claim a free subdomain of devportfol.io, devresu.me, devg.it, codev.space, or devfolio.blog.  All you have to do is email me at tekgadgt@devportfol.io.  Make sure to include the subdomain you would like, as well as where you would like to point it.  If you would like to host your portfolio or git on my servers, please include this inquiry in your email.  Set pricing for hosting has not been established at this time.

## Moving forward

If you would like to follow my progress with this company, as I progress through my career, and as I work on other progress, check back here or at https://blog.ryan.devportfol.io/ regularly for updates.

_This post has been changed slightly from my original blog post to include more recently acquired domains in my suite.  I have plans for, and am working on, building a platform based around all of them._

<hr>

1. [Phonebloks](https://phonebloks.com/)
Perspectives on how to be an effective software architect
Tags: bestofdev, architecture, career
Published: 2019-04-29 19:54:11

I want to share some answers from [this question](https://dev.to/stereobooster/what-should-i-know-to-be-a-software-architect-4ilm) that I found particularly useful.

Even though this question can be taken in different directions, I found these to be good reads no matter what you are trying to get out of the situation.

{% devcomment adkn %}

{% devcomment aeae %}

{% devcomment ae3j %}

Happy coding!
Do you understand your tools and what they are doing?
Tags: podcast, inspiration
Published: 2019-04-29 19:42:48

---
title: Do you understand your tools and what they are doing?
published: true
description: Do you understand what that tool just did for you? Some thoughts on why you need to answer yes. (Podcast)
tags: podcast, inspiration
---

My latest bit of the podcast World.

Do you know what those fancy tools you use are doing? Do you realize what actually happens in the background when you press a button to get an instant effect? You should, one day those tools might change. But understanding what they do is a skill that will always be available to you.

In this short podcast episode, I share my thoughts on the subject and welcome yours. 
https://anchor.fm/peter-witham/episodes/Do-you-understand-your-tools-and-what-they-are-doing--You-Should-and-Ill-tell-you-why-e3ru6g
Handle Async Promises Javascript
Tags: javascript, callback, promises, asynchronous
Published: 2019-04-29 19:20:56

---
published: true
title: Handle Async Promises Javascript
description: Handle asynchronous promises pada pemrograman javascript
tags: [javascript, callback, promises, asynchronous]
url: https://dev.to/guntur/handle-async-promises-javascript-7ck
---


Apabila anda telah terbiasa menggunakan [`callback`][callback_url] pada saat mengolah code yang bersifat `asynchronous`, itu adalah hal yang bagus.


### Callback

Sekilas mengenai [`callback`][callback_url], sudah cukup apabila hanya menghandle flow kode yang tidak terlalu kompleks.

Tetapi apa yang terjadi apabila jumlah baris kode anda sangat banyak, tentu saja akan menyulitkan pada saat mengorganisir dan `debugging` khususnya.

{% gist https://gist.github.com/iguntur/c7d549a39234f039b6ebd7ee3afacf41 file=callback-hell.js %}

Kode diatas adalah contoh `callback` yang apabila semakin dalam subprosesnya (`nested`), maka kode akan semakin tidak rapi dan menyulitkan untuk mengorganisir kode. Kejadian seperti ini dikenal dengan istilah **`callback hell`**.

### Promises

#### Promise (`then`)

Dengan adanya fitur `promise`, ini akan memudahkan kita dalam mengorganizir setiap potongan kode yang bersifat asynchronous. 

{% gist https://gist.github.com/iguntur/c7d549a39234f039b6ebd7ee3afacf41 file=promise-then.js %}

Dari contoh diatas, kKita juga dapat membuat setiap potongan kode async menjadi pipeline yang tersusun rapi dan mudah untuk dibaca.

{% gist https://gist.github.com/iguntur/c7d549a39234f039b6ebd7ee3afacf41 file=promise-then-pipeline.js %}

### Async-Await

Jika contoh diatas menggunakan `promise`, pada contoh ini kita akan menggunakan `async` dan `await` keyword. Keyword `async-await` memberikan cara lain dalam mengekspresikan penulisan code program kita. Perhatikan contoh potongan berikut

{% gist https://gist.github.com/iguntur/c7d549a39234f039b6ebd7ee3afacf41 file=async-await.js %}

Bisa kita perhatikan, ekspresi kode dengan menggunakan `async-await` lebih ringkas dan flow code-nya terlihat friendly.

## Conclusion

Setelah melihat dan mengerti cara menulis `promise` ataupun `async-await`, kita dapat menulis kode program kita menjadi lebih mudah dibaca dan lebih mudah manage kode program kita.

Penulisan menggunakan promise atau async-await cukup relative bergantung dengan context dan case setiap masalah yang akan diselesaikan.

## Terkait

- [Memahami Synchronous dan Asynchronous Javascript](https://dev.to/guntur/memahami-synchronous-dan-asynchronous-javascript-4kjj)
- [Handle Async Dengan Callback][callback_url]

[callback_url]: https://dev.to/guntur/handle-async-callback-javascript-2458
Handle Async Callback Javascript
Tags: javascript, callback, asynchronous
Published: 2019-04-29 19:17:36

---
published: true
title: Handle Async Callback Javascript
description: Handle asynchronous callback pada pemrograman javascript
tags: [javascript, callback, asynchronous]
url: https://dev.to/guntur/handle-async-callback-javascript-2458
---

Di javascript sudah tak asing lagi dengan istilah `callback`. Callback sendiri adalah function yang disisipkan function sebagai `paramater` atau `argument`. Callback sangat erat kaitannya dengan `asynchronous`.

Sebuah fungsi yang menerima `function` sebagai `parameter`-nya, merupakan ciri dari `asynchoronous` function, sehingga dapat kita berikan `parameter` tersebut sebagai `anonymous` atau `naming` function.

```js
function cekTahun(callback) {
    setTimeout(function () {
        callback((new Date()).getFullYear());
    }, 2000);
}
```

Function `cekTahun` menerima sebuah `parameter` atau `argument` dengan nama `callback` bertipe `function`. Pada saat `callback` di `invoke`, akan mengembalikan nilai dari tahun.

Contoh menggunakan `anonymous` function.

```js
cekTahun(function (tahun) {
    console.log('Sekarang adalah tahun:', tahun);
});
```

![handle-async-callback](https://user-images.githubusercontent.com/11140873/56917923-ed6ee180-6ae6-11e9-818f-fb9f0601760c.png)

Contoh dengan menggunakan `naming` function.

```js
function tampilkanTahun(tahun) {
    console.log('Sekarang adalah tahun:', tahun);
}

cekTahun(tampilkanTahun);
```

![handle-async-callback_2](https://user-images.githubusercontent.com/11140873/56917928-efd13b80-6ae6-11e9-88d6-5929b862727a.png)

Terlihat pada gambar, tidak ada perbedaan dari kedua hasil gambar diatas, baik `anonymous` maupun `naming` function. Ini hanyalah cara anda untuk mengorganisir setiap baris kode agar tertata rapi dan mudah dibaca.


### Kekeliruan Umum Mengolah Asynchronous

Kekeliruan umum pada saat menghandle `asynchronous` operation, adalah menghandlenya layaknya `synchronous`. Misalnya...

```js
function cekTanggal() {
    return setImmediate(function () {
        return (new Date()).getDate();
    });
}

const tanggal = cekTanggal();
console.log('Sekarang tanggal:', tanggal);
```

![handle-async-callback_mistake](https://user-images.githubusercontent.com/11140873/56921284-a0433d80-6aef-11e9-9f37-aaf1210cf480.png)

Function `cekTanggal` mengembalikan nilai dari function `setImmediate`, yang tentu saja tidak sesuai ekspetasi anda. Ini adalah kekeliruan yang umum, bahkan saya pribadi juga pernah keliru tentang ini.


## Terkait

- [Memahami Synchronous dan Asynchronous Javascript](https://dev.to/guntur/memahami-synchronous-dan-asynchronous-javascript-4kjj)
- [Handle Async Dengan Promises](https://dev.to/guntur/handle-async-promises-javascript-7ck)
As a conference attendee or speaker what do you generally like and don't like about conference name badges!
Tags: discuss
Published: 2019-04-29 18:15:58

---
title: As a conference attendee or speaker what do you generally like and don't like about conference name badges!
published: true
tags: discuss
---

As a conference attendee or speaker what do you generally like and don't like about conference name badges! What can be done better!! We are listening to #developercommunity!! Share in your thoughts!