teleren/devto huggingface dataset:
FIX: Terraform + AWS: InvalidVPCNetworkStateFault
Tags: terraform, aws, iac
Published: 2019-06-02 15:30:00

---
title: FIX: Terraform + AWS: InvalidVPCNetworkStateFault
published: true
description: While working with Terraform and AWS recently I ran into an error that did not seem to have much information about it. After about a day of research and troubleshooting I was able to solve it. 
tags: terraform, aws, iac
cover_iamge: https://blog.davidjeddy.com/wp-content/uploads/2018/07/hashicorp_terraform-930x514.png
---

<!-- wp:paragraph -->
<p>While working with Terraform and AWS recently I ran into an error that did not seem to have much information about it. After about a day of research and troubleshooting I was able to solve it. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>The Error</h2>
<!-- /wp:heading -->

<!-- wp:code -->
<pre class="wp-block-code"><code>Error: Error applying plan:

1 error(s) occurred:

* module.web_app.aws_db_instance.rds: 1 error(s) occurred:

* aws_db_instance.rds: Error creating DB Instance: InvalidVPCNetworkStateFault: Cannot create a db.t2.micro database instance because no subnets exist in availability zones with sufficient capacity for VPC and storage type : gp2 for db.t2.micro. Please first create at least one new subnet; choose from these availability zones: us-west-1c, us-west-1b.

	status code: 400, request id: ea5f04be-8510-4cfc-9bb2-606c0e00d007
</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>The key takeaways here are RDS, subnets, and availability. So I checked the VPC AZ's, the subnets assigned to them, CIDR ranges, etc. At one point I even compared the VPC configuration to a working zone. From what I could tell no differences existed.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>The Cause</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>After some digging around I noticed the default VPC's subnets had been deleted. This causes the VPC and associated AZ subnets to be invalid in the default DB security group. The only way to recreate default subnets in a region is via the CLI, no web console ability for this action.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>The Fix</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>The fix was to go into RDS subnet group configuration (<a href="https://us-west-1.console.aws.amazon.com/rds/home?region=us-west-1#db-subnet-groups:">https://us-west-1.console.aws.amazon.com/rds/home?region=us-west-1#db-subnet-groups</a>) and re-assign the new two new default subnets to the RDS group. After that Terraform 'plan' and 'apply' returned to working as expected.</p>
<!-- /wp:paragraph -->
Why I Prefer Sidebar Menu?
Tags: design, opinion, ubuntu
Published: 2019-06-02 15:10:12

---
title: Why I Prefer Sidebar Menu?
published: true
description: I prefer sidebar menu over bottom dock and bottom taskbar
tags: #design #opinion #Ubuntu
---

I used operating systems with themes which contain a menu as a bottom bar (**Windows taskbar**), or a menu as a bottom dock / stage (**Mac OS X**), and a menu as a sidebar like **Ubuntu Linux**. Which implementation is better?



I always have too many things as a timeline which scroll vertically and the horizontal zone are not fully useful. There is non-used space in both sides. So I think the Ubuntu implementation of the sticky menu of the operating system is the best implementation. Why?



When I write posts on a blog I occupy almost half of the screen. when I want multitasking I open two programs side by side to use that non-used horizontal space. It is good to give the bottom space to the content too. When you use a screen in portrait mode, you'll be happy with a bottom menu/dock/bar, but when you use a laptop or tablet in a landscape mode (the default mode), you'll enjoy the sidebar menu more.



This blog post is one of my own opinions about design decisions and design concepts of software I use. See you [next blog](https://www.valueinbrief.com).

**P.S**: I know that I can change the placement of the dock/bar but I am talking about the default decision which the majority of users will adapt to and be used to.
Laravel's factory method, but for JavaScript.
Tags: javascript, react, vue, webdev
Published: 2019-06-02 14:40:08

When I became exhausted with trying to create tons of mock API data on the fly for my Node projects, I created a simple little script that would let me define the skeleton of the JSON structure I wanted without having to copy, paste, and modify each individual record.

This script is now available as an NPM package that does almost exactly what Laravel's factory method does except for JavaScript. It's lightweight and great for stubbing APIs in your Vue and React projects, too!

Link to the repo: https://github.com/grahamsutton/factory
My Plans To (Re-)discover Web Development
Published: 2019-06-02 13:20:30

# Hello and welcome fellow developer! 👋

This blog is the beginning of hopefully a great journey for me **(re-)discovering web development**.

I am a freelance web developer and for a long time I had a single (well paying) client, which was great but it didn't let me learn and apply all the things I really wanted to.

I did mostly old-fashioned PHP and jQuery development. I was able to build cool things, but I wanted to create things using more modern web tools available today and stay more up-to-date.

Therefore, I ended the dev relationship with my one client in order to **learn recent web technologie**s and **build cool things** of my own for a few months, starting April 2019. (Don't worry, I ended on great terms with my client and I will continue to do some light consulting work for them).

I know, this is going to be a challenge, especially because I'm a bit behind some of the tech and because there is A LOT of ground I want to cover. Including, but not limited to:

- Getting practice with JavaScript OOP
- Brushing Brushing up my CSS + Animations + SASS
- Getting deeper into Vue.js
- Maybe peak into React
- Learning proper ES6
- Learn Node.js
- Learn TypeScript
- Learn how to use Babel properly
- Learn GraphQL

In this blog, I'll be posting about my progress and share things that might be interesting for fellow developers or aspiring developers.

If you want to cheer me on, do this best on Twitter ([@_marcba](https://www.twitter.com/_marcba)), where you can also find more content.
Must-play games with great mechanics
Tags: games, mechanics, mustplay
Published: 2019-06-02 12:40:58

---
title: Must-play games with great mechanics
published: true
description: 
tags: games,mechanics,must-play
cover_image: https://gamemechanicexplorer.com/assets/welcome.png

---

Both AAA and Indie games often come with great gameplay mechanics and features that make them stand out from the crowd. 

So, am asking you. What are some video games that you think every game developer must play at some point in their life?
Updated Expo Web with Amplify Console Tutorial
Tags: expo, reactnative, amplify, aws
Published: 2019-06-02 12:12:10

---
title: Updated Expo Web with Amplify Console Tutorial
published: true
description: 
tags: expo, react-native, amplify, aws
---

This week the preview of Expo SDK v33 got out!

Now we can create _universal_ Expo apps for Android, iOS, and Web with one code-base.

[I updated my tutorial to use Expo Web with the AWS Amplify Console.](https://dev.to/kayis/use-expo-web-with-the-aws-amplify-console-170m)
Development Update on Verge #22
Published: 2019-06-02 12:08:14

Did you think we were all going to vanish after announcing the codebase and partying up at the Verge Meetup? Think again! We're still here, with some fresh off the keyboard development update! Without further hesitation, let's get into it.

## Codebase Release

On the 16th of May, my fellow teammate Marvin Piekarek pushed the latest release of our codebase, named Lumos. In case you missed it, you can read the press release here.

Without getting too technical, we found a bug when creating a stealth address and then encrypting the wallet, which would make that stealth address unusable. This critical bug was fixed a few days later when we pushed for the 5.1 release.

Currently, we are working on a newfound issue which causes the reindex process to crash when launching the daemon in -reindex mode.

You can follow the bug resolution directly on GitHub, but apart from this everything else is working great!

## iOS Wallet

After the iOS wallet release, the workload hasn’t stopped. Our iOS team is currently working on… wait for it… Moon Mode!

No, it doesn’t shoot Verge’s price to the moon (sorry, your adoption will do that), but The _"Swenator"_ is a king for naming things and thus he has named the dark mode, Moon Mode.

{% twitter 1133844664564555777 %}

In the meantime, our great community has struck again, already providing translations for the wallet in 12 languages! Thank you very much for helping Verge being spread across every border!

Ivan made a great video showing how easy it is to switch between different languages, here it is:

{% twitter 1130355851338887168 %}

##Android Wallet

While we don’t have shiny screenshots of the Android wallet, there has been a lot of code written to prepare for the integration of our Verge Wallet Service. Once this step is completed, VWS features will be used and we will start planning a public beta for testing the wallet. If we summarize that with a sentence, it’s the last step before being able to send and receive funds!

While this sounds great, there is no time frame for that, although Manuel stated at the meetup that he wishes to be done before the end of 2019 (for the beta).

As always, I’d like to take a minute to thank our amazing community that helps us grow every day. This means translators, contributors on GitHub, users, followers and also haters.

_That’s all! Thanks for reading!_
A quick way to automate your conda uninstalls
Tags: littlehacks, conda, python3
Published: 2019-06-02 11:23:57

---
title: A quick way to automate your conda uninstalls
published: true
description: 
tags: #little-hacks, #firstyearincode, #conda, #python3
---

It's been a while since my last article, truth be told it was an over-demanding set of months for me and not only in my professional life. One of the best things though, I have done during this past period was to submit a chapter to [First year in code](https://leanpub.com/firstyearincode) (Thanks @isaacdlyman for the opportunity :) )

Today, I am gonna showcase a python script I made, to help you uninstall all the anaconda packages that match a certain filter.

Here is the whole script. Nothing much, nothing worth a Turing award, just thought it would be useful to someone.

```
import os

# Example function, not uninstall packages with the 
# digram py in their name. Please update accordingly
def filter_function(name):
    return 'py' not in name

# Get the installed conda packages
conda_list_output = os.popen('conda list').read()

# Put them in a list
output_in_lines = conda_list_output.split('\n')

# Line 4 and onwards is what we want (feel free to examine it)
output_in_lines = output_in_lines[3:]

# Name appears in the beginning of the line
only_names = [line.strip().split(' ')[0] for line in output_in_lines]

# Apply the filter defined above
filtered_list = list(filter(filter_function, only_names))

# Convert the list of uninstall candidates to a string
# and run the unins
cmd = f'conda uninstall {" ".join(filtered_list)}'

os.system(cmd)
```

There is extensive logging in the file but if you are a TL;DR guy

- We get the list of packages
- We clean it and convert it to a friendly format
- We filter out the unwanted ones
- We build and run the uninstall command

The only thing you need to change is the filter function, you can make the filter as sophisticated as it gets

Thank you for reading this really short article. Let me know if this was helpful. :)
How to keep your forked GitHub repository up to date
Tags: git, github
Published: 2019-06-23 12:14:38

---
title: How to keep your forked GitHub repository up to date
published: true
tags: git,github
canonical_url: https://ofdigitalwater.postach.io/post/how-to-keep-your-forked-github-repository-up-to-date
---

### 1. Clone your fork:

```
git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

```

### 2. Add remote from original repository to your forked repository:

```
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream

```

### 3. Updating your fork from original repo to keep up with their changes:

```
git pull upstream master

```

Source: [this gist](https://gist.github.com/KINGSABRI/b7a07fee84affc7d041acc48e9cb4a7e)
dev.to Proofreading Community
Tags: proofreading, authors
Published: 2019-06-02 10:54:42

---
title: dev.to Proofreading Community
published: true
description: should we create a proofreading community?
tags: proofreading,authors
---
When writing an article, proofreading is one important step before publishing. But even with thorough proofreading by the author, problems of any kind will slip through. It could be small typos, structural issues or things that the author assumed the readers to know.
Luckily, this great inclusive community does not make fun of authors. But I would assume, that most authors strives to write a good article, no matter how indulgent the readers are.

As I am not a native speaker, I appreciate someone proofreading my articles, moreover I would value any feedback regarding content and structure. And don’t know why, but I don’t want my colleagues to proofread (for no specific reason).

Long story short: What do you think about building up a proofreading community?

I’m thinking about something that could be backed by technology on dev.to:
- Authors can join the proofreading community
- the can provide tags they are familiar with
- once an article is done by the author, the status can change to “proofreading”
- authors with matching tags will get it in their inbox
- you could even get some credits

I’m sure this will only work with mutual help but this awesome community could make it work.

What do you think?
[Done Quick] Easy Lazy loading with Angular 8
Tags: angular, architecture
Published: 2019-06-02 10:40:44

---
title: [Done Quick] Easy Lazy loading with Angular 8
published: true
description: Lazy modules loading has always been part of angular, but version 8 made it easy. Let's look at it.
tags: angular, architecture
---

Here are the steps to quickly add lazy loaded modules (loads only after the user navigates to a specific feature or page):

Note that your app must be arranged as feature modules instead of one big AppModule. Make sure that you have installed latest angular cli with the command `npm install -g @angular/cli`. 

_step 1_: create a Demo App

`ng new MyApp --routing`

_step 2_: Add a feature module and component inside the new module which needs to be lazily loaded

`ng g module feature --routing`
`ng g component MyFeature --module=feature`

_step 3_: In your `app.component.html` add a link to the lazy module

`<a routerLink="/feature">Lazy feature</a>`
note that this file also has `<router-outlet></router-outlet>`

_step 4_: Add Lazy loading to the main app router file (`app-routing.module.ts`). Notice the import statement - this is where the magic happens!

```
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [
  {
    path: 'feature',
    loadChildren: () =>
      import('./feature/feature.module').then(module => module.FeatureModule)
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
```

_step 5_: Finally, add lazy routing to feature module routing file (`feature-routing.module.ts`)

```
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MyFeatureComponent } from '../my-feature/my-feature.component';

const routes: Routes = [{
  path: '',
  component: MyFeatureComponent
}];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class FeatureRoutingModule { }

```

That's it! Run the project with `ng serve` and click the link in your new app. See the browser console for the lazy loaded module.

![Devtools show lazy angular module loading](https://thepracticaldev.s3.amazonaws.com/i/epjztun291kukpj20zdz.gif)
Implementing a 'radio button' in Golang shell program
Tags: ux, go, shell, gopher
Published: 2019-06-02 09:27:49

I came across this question in the Gopher slack channel and I thought I might have a crack at answering it. Gopher newbie, so as always C&C welcome and appreciated!

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

@J so you want to prompt with a question first. The code for this is pretty simple; 

```go
reader := bufio.NewReader(os.Stdin)
fmt.Print("? How would you like to use ESLint??")
```

Now the next part is a bit ambigious, because while you mention radio button like behaviour, the screen shot you supplied is actually a selector that you navigate by using the directional keys. If it were an actual radio button, you could simply attach a value to each of the options, and then execute the code you want depending on the answer. For example

```shell
? How would you like to use ESLint?
> To check syntax only (1)
> To check syntax and find problems (2)
> To check syntax, find problems, and  enforce code style (3)
$ > 3
! You have selected the syntax only mode
```

To implement this would be pretty simple too. 

```go
reader := bufio.NewReader(os.Stdin)
fmt.Print("? How would you like to use ESLint??")
fmt.Print("To check syntax only (1) ")
fmt.Print("To check syntax and find problems (2) ")
fmt.Print("To check syntax, find problems, and enforce code style (3) ")

answer, _ := reader.ReadString('\n') // Allow user input up until and including \n
answer = strings.TrimSuffix(answer, "\n") // Remove trailing \n from string
if answer == "1" {
  // check syntax code execution
} else if answer == "2" {
  // check syntax and find problems code execution
} else if answer == "3" {
  // check syntax find problems and enfore style code code execution
} else {
  fmt.Print("Answer isn't recognised")
  // start again
}
```

I would probably use a switch statement to make it a little more cleaner too, and also wrap the question printing and answer gathering into a function that would be called when the answer isn't recognized. but then again, there's quite a bit of refactoring that you could do. 

If you wish to implement the selector behaviour, where you can navigate the options with the directional keys, it would be more complex (I'd imagine). You'd have to find a way to;

1. Print multiple lines that can be navigated
2. Allow user to navigate the lines (probably by using the same method as above, but triggering navigation when the arrow keys are pressed)
3. Highlight the line currently being selected
4. Run behaviour based on selected option when the enter key is pressed.

Personally, I feel like that's a lot of work for not much gain in UX, but it definitely is possible in Go, as are all things if you put your mind to it!
#PureCSS - Responsive Letter T
Tags: codepen, css, purecss
Published: 2019-06-02 08:56:58

---
title: #PureCSS - Responsive Letter T
published: true
tags: codepen,css,purecss
---

<p>Responsive Letter T using CSS</p>

[Design Source](https://dribbble.com/shots/6176376-T-Letter-Logo)

{% codepen https://codepen.io/AsyrafHussin/pen/yWGwGx %}
Can you create an accessible React component?
Tags: a11y, react, javascript, challenge
Published: 2019-06-02 08:32:44

---
title: Can you create an accessible React component?
published: true
description: Do you want a challenge? Try to create accessible React tabs component.
tags: [a11y, react, js, challenge]
series: Accessible React
cover_image: https://thepracticaldev.s3.amazonaws.com/i/rdisx3ft1tplm446m2uz.png
---

Let's try a fun experiment. In the [first post](https://dev.to/stereobooster/accessible-react-accordion-component-4p99), we talked about how to create React accessible component, in the [second one](https://dev.to/stereobooster/testing-accessibility-with-cypress-2dfo) how to test it, in the third one I propose you to try to write accessible component yourself. (Strictly speaking, it doesn't have to be React, but I won't be able to review it otherwise)

We will try to write accessible tabs component. There is [WAI-ARIA Authoring Practices 1.1. recommendations](https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html).

I created [a starter repository](https://github.com/stereobooster/react-accessible-tabs) with Cypress tests according to recommendations. I tried my best with those test, but they may need some adjustments - it is hard to do test first approach with e2e tests, it works smoothly only for unit tests. There is Travis CI which will run tests.

Tabs component is pretty similar to the accordion component, about which we talked in the first post, so you can use the first example as inspiration. This can be a nice learning experience. I learned thing or two while I created and fixed bugs in the code for the first post.
From here Genetic Algorithms looks easier🤔
Published: 2019-06-02 08:02:39

In this writing I have tried to notedown the process of writing your first basic GA’s Rather than going into the details.I have assumed that you have resources for learning it..If not stay tuned as I will be writing my next thing(whatever it is) with the details of Basic GA and its implementations.

[if you don’t know what’s GA there are some links at the bottom you might be looking for]

Sometimes people find it very hard to understand the working this algorithm from an abstract view..but believe me it can be more interesting once you Understand the concept behind it..which includes the knowing its significance , its application and etc…

Imagine a bunch of objects made by you is evolving and eventually growing a brain of themselves just infront of you..

Gave a grandpa kinda feeling , didn’t it 😂…seeing you grandchildren grow up!

=>The steps you should follow to master this algorithm!

(I assume you have done a pretty good homework about GA and know what is basically is.)
 ..First of all never try to mug up a single calculation in it!!!

Understand the core concepts of genetic algorithm…You can google about the DARWINIAN GENETIC ALGORITHM and clear your concepts.


1 . After its done and you feel confident about it..Its time to get the first shock..TRY TO CODE OUT WHAT YOU JUST LEARNED IN THE DARWINIAN ALGORITHM…

2 .I assume you are stuck now….(if not good job…I’m clapping 👏 go to the bottom to see some interesting videos on genetic algorithms)

3 . Here comes the saviour step now!! Leave whatever project you are on ..watch this type of videos in the provided link well for me this is the simplest you can refer to. https://youtu.be/bGz7mv2vD6g

4. While watching the video try to compare that with your own project. Generally you can relate easily …Do same kinda stuff he is doing in this video…

5 . Note down every step and understand the purpose..

6 . While Writing your code, you can have a tons of error working with multiple classes..One thing you should never do is doubt the framework you are using…

7 . Try and debug the whole code. the time of completion can vary from several minutes to days depending on you effort and efficiency…

8 . But always imagine the moment you are done with the code and the objects are actually evolving infrontof you!! And eventually you will get to the end point..

9 . But to have a check on yourselves if you have understand it or not.. Write some other code using Genetic algo’s with other variations you can think of..

IF YOU MADE TO THE END

CONGRATULATIONS 🎉

Happy coding😄😄

Some interesting GA videos on YouTube..

1 . https://youtu.be/FKbarpAlBkw

2 . https://youtu.be/bGz7mv2vD6g

3 . https://youtu.be/9zfeTw-uFCw

4 . https://youtu.be/VnwjxityDLQ