teleren/devto huggingface dataset:
How to install Go and write a HelloWorld program in 4 steps
Tags: go, linux, backend
Published: 2020-07-06 16:02:27

---
title: How to install Go and write a HelloWorld program in 4 steps
published: true
description: Quick tutorial on installing GoLang and setting up the recommended environment on fresh Ubuntu 20 installation.
tags: go,linux,backend
cover_image: https://web3coach-public.s3.eu-central-1.amazonaws.com/blog/devto/hello_world.png
canonical_url: https://web3.coach/golang-how-to-install-go
---

There is something about the official Go installation instructions that keep confusing developers, myself included - so here is a quick tutorial on how I setup Go on my new MSI laptop running the latest Ubuntu 20.

## 1/4 Download Go

Visit [Go web](https://golang.org/dl/) and check the latest version: **1.14.2**

Fetch the Go source to `/usr/local/` dir:
```bash
sudo wget -c https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
```

## 2/4 Configure the ENV

I like to keep all my Go projects in `$HOME/go`.

Depending on your setup, add the following 2 env variables to your shell configs and define the desired paths.

Check your shell:
```bash
echo $SHELL
/usr/bin/zsh
```

Because I use ZSH, I will add the 2 vars to the `$HOME/.zshrc` config file:
```bash
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
```

Reload the config:
```bash
source $HOME/.zshrc
```

## 3/4 Validate the installation

```bash
go version
go version go1.14.2 linux/amd64

echo $GOPATH
/home/web3coach/go

echo $PATH
usr/local/go/bin:/home/web3coach/go/bin
```

Perfect. Let's write a simple Go program to ensure everything works well.

## 4/4 Program Hello

Create the Hello's project dir:
```bash
mkdir -p $HOME/go/src/hello
cd $HOME/go/src/hello
touch hello.go
```

Paste the following Hello's code into the `./hello.go` file:
```go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
```

### Compile
```bash
go install
```

A new program's binary will be generated and stored in `$GOPATH/bin` dir:
```bash
ls -la $GOPATH/bin

drwxrwxr-x 2 web3coach web3coach    4096 čec  5 19:25 .
drwxrwxr-x 4 web3coach web3coach    4096 čec  5 19:25 ..
-rwxrwxr-x 1 web3coach web3coach 2076690 čec  5 19:25 hello
```

`hello` is your new generated program's binary. You can now execute it from any directory because the `$GOPATH/bin` is included in your previously configured `$PATH`.

```bash
hello
```

**Output:** "Hello, World!"

## Summary
You installed Go 1.14.2 and fully setup its environment. If you want to know how to develop a blockchain from scratch in Go - follow me on Twitter: [https://twitter.com/Web3Coach](https://twitter.com/Web3Coach)
Generalist vs Specialist
Tags: discuss, career
Published: 2020-07-06 15:57:24

You've seen it on job postings whether they explicitly say it or not. 

>_"We are looking for someone highly skilled in {insert fresh technology here} and has experience building..."_

Or maybe something like this

>_"We searching for someone with experience in {this thing},{that thing}, {and a little of this}..."_

Which one is more catered to you? Do you try to be an expert in a technology, or do you want to be more of a generalist in your career? 

Bonus Question: Those who have switched from a generalist (full stack with different languages) to a more specialist (maybe fullstack javascript) role, what are the pros and cons for you?





[_Image Credit_](http://huntertechglobal.com/tag/full-stack-developer-vs-software-engineer/)
What are your best and worst CMS migration stories?
Tags: discuss, cms, webdev, database
Published: 2020-07-06 15:55:40

Have you ever needed to switch from one content management system to another? Maybe you were moving from something closed-source to something open source. Maybe moving from something older to something fancy and new? Maybe from something traditional like WordPress to one of those cool new "Headless CMSs."

Whatever the reason, there's always things that go great and things that go... unexpectedly.

What are you best and worst stories from migrating a site from one CMS to another? What bugs did you find? Did you redesign at the same time? Were your editors scared or excited?
Array Map
Published: 2020-07-06 15:49:43

Arrays are an amazing data structure. They can do so much. One of the best things they can do is become a different array. That's what map is for.

If you aren't comfortable with the map function, we'll fix that today. I'll explain it here, and then down below is the opportunity for you to practice. Be SURE to do the practice if you actually want to learn. Don't just read. You'll forget it all tomorrow. But if you do the exercises, you'll remember most of what you learn.

So let's break this down.

Given the following array:

![image](https://cdn-images-1.medium.com/max/800/0*Wg4rHrwwbwWCtOum.png?)

we can use the map function to create a new array of JUST the names of the users.

So doing this:

![image](https://cdn-images-1.medium.com/max/800/0*WvE-OV_rsSBbyu9q.png?)

will produce this:

![image](https://cdn-images-1.medium.com/max/800/0*pbdj6aXKHu67otFH.png?)

We can modify each element as well. The following map will produce the following array:

![image](https://cdn-images-1.medium.com/max/800/0*xjKmNzcsDJZRtQ2R.png?)

And we can combine elements as well:

![image](https://cdn-images-1.medium.com/max/800/0*Y4lpf5fdk2p_gxa5.png?)

OK. Time for YOU to learn to use the map function. The following link has 4 simple exercises to cement your knowledge of how map works.

https://stackblitz.com/edit/array-map-exercises?file=index.js

Happy coding!

Signup for my newsletter [here](https://thinkster.io/?previewmodal=signup?utm_source=devto&utm_medium=blog&utm_term=arraymap&utm_content=&utm_campaign=blog).

Visit Us: [thinkster.io](https://thinkster.io?utm_source=devto&utm_medium=blog&utm_term=arraymap&utm_content=&utm_campaign=blog) | Facebook: @gothinkster | Twitter: @GoThinkster
Search as you type at 60fps with js-coroutines
Tags: react, javascript, webdev
Published: 2020-07-06 15:21:26

It's nice to be able to make user interfaces that require the least number of clicks for the user to achieve their goal.  For instance, we might want to search a list as we type. The challenge is though, as the list gets bigger there's a chance that the whole user experience will degrade as our JavaScript hogs the main thread stopping animations and making the whole experience glitchy.

This article will show how we can quickly modify a standard search function to use [js-coroutines](http://js-coroutines.com) and keep the fully responsive experience with very little extra effort.

Let's say we have a list of 1,000,000 items and we have a text box, as the user types, we'd like to return the first 50 entries that have words that match the words they've typed (in any order).

For this example, we'll use "unique-names-generator" to create a list of nonsense to search on!  Entries will look a little like this:

```
Aaren the accused lime flyingfish from Botswana
Adriana the swift beige cuckoo from Botswana
```

Our search function is pretty simple:

```js
function find(value) {
    if (!value || !value.trim()) return []
    value = value.trim().toLowerCase()
    const parts = value.split(" ")
    return lookup
        .filter(v =>
            parts.every(p =>
                v.split(" ").some(v => v.toLowerCase().startsWith(p))
            )
        )
        .slice(0, 50)
}
```

But with 1,000,000 entries the experience is pretty woeful.  Try searching the in the screen below for my favourite dish: 'owl rare', and watch the animated progress circle glitch...

{% codesandbox dx9ek %}

This experience is atrocious and we'd have to either remove the functionality or find a much better way of searching.

[js-coroutines](http://js-coroutines.com) to the rescue!  

With js-coroutines we can just import the `filterAsync` method and re-write our "find" to be asynchronous:

```js
let running = null
async function find(value, cb) {
    if (running) running.terminate()
    if (!value || !value.trim()) {
        cb([])
        return
    }
    value = value.trim().toLowerCase()
    let parts = value.split(" ")
    let result = await (running = filterAsync(
        lookup,

        v =>
            parts.every(p =>
                v.split(" ").some(v => v.toLowerCase().startsWith(p))
            )
    ))
    if (result) {
        cb(result.slice(0, 50))
    }
}

```
Here you can see we terminate any currently running search when the value changes, and we've just added a callback, made the function async and that's about it.

The results are much better:

{% codesandbox r0kx3 %}


[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qc7xww7co3re0jr8weh1.png)](http://js-coroutines.com)
Listening for a Form Submit in JavaScript
Tags: javascript, webdev, html
Published: 2020-07-06 15:09:40

## What is a Form Submit?

Simply put it's submitting a form... Basically, when you fill the form out with whatever information it asks for you want to do something with that information. We can do all manner of operations with this data and that's dependent upon your application's tasks and the purpose of the form. 

A contact form should provide ways to get in touch with a specific person; a suggestion form should include an issue or improvement to be logged; an email subscription sign-up should have... well, an email. You get the point.

## How do we listen for the submission?

First, we're grabbing the element (the form in this case) that we want to listen to. Keep in mind, this is using the basic _form element selector_. If you have multiple forms on your page this will only return the **first occurrence** of a form.

If you do have multiple forms, you'll want to add an `id` tag to _each form_ specifying what it's for - that way you can safely select the form you want and attach the appropriate event listener.

```js
  const form = document.querySelector('form')
  form.addEventListener('submit', (event) => {
    // Add code for functionality you need here
  })
```
Or you can simply chain the method calls like so...

```js
  document.querySelector('form').addEventListener('submit', (event) => {
    // Add code for functionality you need here
  })
```
This chaining is especially useful when you know you'll only have one event to listen for. No need to grab the element in question and store it in a variable if you're only going to add one event listener.

## Why are we not listening to the submit button?

For us to have access to the information the user has entered we listen `form`. The `button` will not actually be targeted by a submit event. The `button` is the **submitter**.

This is apparent when you look in the `SubmitEvent` object that is generated when a form is submitted; there is a `submitter` property in which you'll see the element triggering the submission. So we listen for submission on the `form` and the `button` is the one that **_triggers_** that event. 

Our submit `button` plays a pivotal role to get this all to work, however, our `form` is the element on which the submit is actually fired and thus the element we should listen to.
Button_and_Menubar in Flutter
Tags: flutter
Published: 2020-07-06 15:08:32

If you are a beginner in Flutter, then here you will learn how to create a Menubar and button. 
What you will see in this article:
1. StatelessWidget
2. RaisedButton
3. Drawer
4. AppBar

I have used Codepen for writing code. Don't worry if you are new to it. Click on Flutter - code will display, and Click on Result- Final results of the code will display.

All the best. Happy Coding!!!
 

{% codepen https://codepen.io/geeky-star/pen/xxZYNVR %}
Set - Unique values collection javascript way
Tags: javascript, set, unique, collection
Published: 2020-07-06 15:03:09

---
title: Set - Unique values collection javascript way
published: true
description: 
tags: #javascript #set #unique #collection
//cover_image: https://direct_url_to_image.jpg
---

**Background before we dive in:**
Recently, I came across a problem where I had to load images from a third party server using ids given to me. Calling an API to load those images would be an expensive operation since size of the image varied and was unpredictable. Additionally, list of ids had duplications.

**Set to the rescue:**
I wasn't aware of an easy way to create list of unique values in javascript and decided to pursue that knowledge. 

Set is an object which lets you store unique values of any type. 

```
let mySet = new Set();

mySet.add('a1s2d3');
//['a1s2d3']

mySet.add('z4t6h8');
//['a1s2d3', 'z4t6h8']

mySet.add('a1s2d3');
//['a1s2d3', 'z4t6h8']
```

It prevents duplication when you try to add same value again. This was the best way to solve my problem.

It works even in a situation with more complex objects.

You can follow a detailed documentation on MDN Website. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set

----

This is my first dev.to post! I appreciate your time reading this. Any feedback is welcome.
How to Set Up Shadow CLJS
Tags: clojure, functional, tutorial
Published: 2020-07-06 14:34:21

This is a simple walkthrough of how to set up a shadow cljs project

{% youtube p61lhOvQg2Q %}

## Included in video
- Configuring a shadow-cljs edn file
- Adding clojurescript support in the chrome console
- Adding CLJS/JS dependencies and interoping with existing Javascript libraries

The completed shadow-cljs.edn file will look like this
```clojure
{:source-paths ["src/cljs"]
 :nrepl {:port 9000}
 :dependencies [[cider/cider-nrepl "0.21.0"]
                [binaryage/devtools "1.0.2"]
                [lilactown/helix "0.0.13"]]
 :builds {:app {:target :browser
                :output-dir "resources/public/js"
                :modules {:main {:init-fn app.core/init}}
                :devtools {:preloads [devtools.preload]
                           :http-root "resources/public"
                           :http-port 3000}}}}

```

## Resource Links
[Shadow CLJS](http://shadow-cljs.org/)
[Shadow CLJS Docs](https://shadow-cljs.github.io/docs/UsersGuide.html)
[Lokeh/helix](https://github.com/Lokeh/helix)

## Follow and support me
- [YouTube](https://www.youtube.com/c/kelvinmai)
- [Twitter](https://twitter.com/kelvinmai)
Production-Ready Serverless is back (with improved curriculum)!
Tags: aws, lambda, serverless
Published: 2020-07-06 19:54:17

---
title: Production-Ready Serverless is back (with improved curriculum)!
published: true
date: 2020-07-06 14:19:38 UTC
tags: AWS,Lambda,Serverless
canonical_url: https://theburningmonk.com/2020/07/production-ready-serverless-is-back-with-improved-curriculum/
---

![header](https://dev-to-uploads.s3.amazonaws.com/i/yuciyiwrg3rqau1nd06r.png)

My **4-week** [Production-Ready Serverless](https://homeschool.dev/class/production-ready-serverless/?source=monkblog) workshop is back! With an improved and more comprehensive curriculum based on student feedback from the last run in May, when over 50 students from around the world took part.

This is a **hands-on** workshop where you will learn **best practices** for building serverless applications by building an e-commerce solution from scratch.

**By the end of the workshop, you should have a clear idea when serverless is a good fit for your system and common pitfalls to avoid.**

![testimonial](https://dev-to-uploads.s3.amazonaws.com/i/b0p1fz1v36horx984tl0.png)

You will follow along with my instructions and build a web application step-by-step. Along the way you will learn how to:

- implement server-side rendering
- authenticate users with Cognito
- securing internal APIs with AWS\_IAM
- testing strategies for serverless
- CI/CD best practices
- manage application configurations and secrets
- security best practices
- logging best practices
- monitoring & alerting best practices
- distributed tracing with X-Ray
- automatically capture and forward correlation IDs
- and much more!

Check out the full curriculum [**here**](https://homeschool.dev/class/production-ready-serverless/?source=monkblog).

It’s a workshop **for beginners and experienced AWS engineers alike** , there’s truly something for everyone here as we take a deep dive into some of these topics. And of course, you can ask other questions on Discord or during our weekly live Q&A too!

And all materials are available to you forever after the workshop.

[**Enrol now**](https://homeschool.dev/class/production-ready-serverless/?source=monkblog) and **SAVE 15% OFF** with the promo code “yanprs15”.

Hope to see you in Sep!
Week 7: Continuation of Projects
Tags: career, beginners, internship
Published: 2020-07-06 14:01:11

# **HAX Update**
This week I continued to conduct user testing interviews to get a better understanding of the people who use HAX. So far, I interviewed three people and found interesting insights from each one. All of the interviews were about 20-45 minutes long, and I asked them a range of questions like: why do you use HAX? What are your thoughts on a certain menu bar? How familiar are you with HAX?

During the interviews, I wrote down quick bulleted notes that caught my attention. Next, I created a board that outlined all of the different user groups and their thoughts. By doing that, I can quickly refer to one specific interview and see what their response was and compare and contrast the different user groups. I am using a website called Mural to display my findings visually. Mural is similar to Miro, which I have used before, so I am quite familiar with these brainstorming platforms. 

My next step is to interview one or two more people. I have enjoyed the interviews, especially with the users that I didn’t know too much about. Learning about their day to day tasks and overall goals will help redesign the menu system because I now know their comments, which I can accommodate. 

# **Valley Bank Update**
Like I mentioned last week, I am involved in a bunch of different projects. I am involved in an AP automation project where we are trying to hone in the various vendors and segments. We have been doing a lot of brainstorming sessions, similar to the ones in the past, to figure out which groups we need to prioritize. 

Another project I have been working on is with Kontent. Someone on the team put together a master list of issues that should be fixed. I have gone in here and there and resolved some of the problems. At first, I was a bit confused with Kontent because there are so many steps that don’t seem necessary but are quite remarkable. Luckily I had someone guide me through a couple of examples, and now I am a lot more comfortable working on Kontent’s platform.

The final project I have been working on this week was with mortgages. Last week I was given some interviews to review from employees at the bank. After reading three interviews, I got a better understanding of their problems, like clients not being able to work well online and the manual entries they have to do during a mortgage process. Next, I read the software they are currently using, Encompass, documentation. I then helped with making a process chart, depicting each stage to show how complicated and rigorous the current process is. After that, I hopped on a couple of training sessions with employees where they gave us a tutorial on how Encompass works. Visually seeing how it works helped learn about the overall flow and made us question whether each step is necessary or not. 

# **Overall**
This past week has been a continuation of my last week. There were no new projects added, but progressing more in-depth into the current projects I am working on. I feel like this upcoming week will probably include the same sort of thing, but we will see!
Scoping in Javascript
Tags: javascript, es6, webdev, beginners
Published: 2020-07-06 13:42:52

Scoping is mainly deals where variables,functions and objects are accessible in your code during the execution of program.The scope of a variable accessibility is controlled by the where the variable declaration is actually done in #JavaScript.

##Scoping:
JavaScript rules with three different keywords to declare a variable which will deals with scoping in terms  of functional block scoping with different declaration of variable.

In JavaScript has  two scopes:
1.Global Scope
2.Local Scope 

1.Global scope:
Variables  which are defined outside any function, block scope have global scope. Variables in global scope can be accessed anywhere.

{% runkit %}
var test = "hello";

function sayHello() {
// Initialize a local, function-scoped variable
var test = "world";
console.log(test);
}

// Log the global and local variable
console.log(test);
sayHello();
console.log(test);
{%endrunkit%}

2.Local Scope 
Variables with Local scoped are only accessible within their local scopes.Variables declared within a function are in the local scope.Local scope is also called function scope because local scope is created by functions in JavaScript.Variables in the local scope are only accessible within the function in which they are defined.

when we go through below 'let' — which is block scope variable — It will perform same action over the block.

{% runkit %}
function sayHello() {  
  let myname = 'User1'
  console.log(myname); // 'User1'
}

sayHello();

console.log(myname); // myname is not defined 
{%endrunkit%}

##Conclusion:
1.Global Scope variables will be access everywhere.
2.'const' and 'let' are block scope variables which will be access in block only.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lpnngt0h3legwl1ekf4h.PNG)
TIL: Trello Card Templates
Tags: trello, todayilearned
Published: 2020-07-06 13:34:04

I use Trello for my day job, mainly to manage my activities and keep tab on things that aren't resolved immediately. And also poke the team members that are using it. 😉

And I just came across Trello Card Templates! 🤯
I've been hand creating the same cards over and over for certain things.

👉 https://blog.trello.com/trello-card-templates

Def saves a lot of time copying and pasting, I was copying the cards themselves, which I found copied the comments as well, which I didn't want.

So just a small #TIL moment. It's these small wins that makes it nice. #HappyMonday!