teleren/devto huggingface dataset:
How to set right learning goals for the upcoming year?
Tags: javascript, react, discuss, beginners
Published: 2019-01-04 09:44:36

---
title: How to set right learning goals for the upcoming year?
published: true
description: 
tags: javascript,react,discuss,beginners
---

Hello everyone, this is my first post here, so hopefully, I won't break any rule.
I'm a frontend developer mostly focused on js and learning react.
I have 2 and a half years of working experience as a frontend developer. I love to learn but because I can't afford a mentor I need to be self-taught. So it's time to set proper goals for next year.
I know: ES6 features, but I don't know stuff like promises, generators iterators, decorators, weakmap, weakset. Simply because I never had a need to use them.
Http clients like axios and browsers fetch API.
Used libraries like visjs, momentjs.
Browser storage: localStorage, sessionStorage.
React: I know to create a simple project with crud operations, to connect with API and list items, to create routes. The only thing it's not crystal clear to me is new component update lifecycle methods.
React I don't know: is to properly plan project and to decide how I will organize where should a state be. I'll manage to do it it will work but it will be messy. Reason for this is I'm only working in React in my free time (for a year now) and I don't have someone more experienced to do me a code review.
I' have experience with working with basic authentication in react to maintain authenticated state over the app.
So this is a list just from the top of my head, but it gives a picture about what I think I know :)
So my goals (for now):
1) Read a book from Dr. Alex Rauschmayer exploring es6
2) React hooks (Still didn't touch it)
3) Algorithms and data structures in javascript.
4) Graphql (don't need it but it looks really interesting)
So my question is can anyone give any tip what is next I should learn? New language maybe like TypeScript (even there is no need for me to know it at current position) to give myself some intimidating project I'll work over the next year maybe? Focus more on javascript? But Ill appreciate every suggestion.
MySigMail - UI Email Signature Generator on GitHub
Tags: vue, email, discuss, showdev
Published: 2019-01-04 08:30:51

---
title: MySigMail - UI Email Signature Generator on GitHub
published: true
description: UI Email Signature Generato
tags: vue, email, discuss, showdev
---
![](https://thepracticaldev.s3.amazonaws.com/i/zm2m4t2icpji4oh94363.png)

Creating an email signature is not a trivial idea, even for people who have knowledge of HTML and CSS. And what about ordinary users.

There are many solutions on the Internet, and most of them are paid. There are free, but all of them are closed source. I wanted to make a free application with a user-friendly interface and open source code.

So let's make creating email signatures easier!

https://github.com/antonreshetov/mysigmail
Bash magic spell to replace files
Tags: tips, bash, terminal
Published: 2019-01-04 07:22:47

---
title: Bash magic spell to replace files
published: true
description: How to replace data in multiple files with bash 
tags: tips, bash, terminal
---
![bash](https://thepracticaldev.s3.amazonaws.com/i/mahrtqnqhpmbssxs0hkr.jpg)

Most recently, at my work project, I assigned myself to a task to replace a png file across the project with new graphics.
Same file name, different pixels.  
A quick search for the file in VSCode showed around 35 results across different folders.

> But why there are 35 copies of the same png in the project?  
> Good question for which I have no answer 🤔

What a can be done here to complete the task?

1. Manually track all the files in file explorer and replace them. This can take around 15 to 25 minutes depending if you double check copies and how fast you click... boooooring!

2. Or find a bash command to do the work for you.

**Challenge accepted!**
What should be done?

- have a reference to file with new data

- find the file by name

- replace found file with new data

- repeat until all files in the folder are changed

After some googling, reading stack overflow and MAN pages, I stitched this line to replace a file with new data:

```bash
find . -print -type f -name apple.PNG -execdir cp /mnt/c/Users/Maciej_Chmura/replace_source/orange.PNG {} \;
```

Let's break it down to know exactly what is happening:

```
find 👉 bash find command
. 👉 current execution context, current folder
-print 👉 log the process
-type f 👉 specify to look for files
-name file_name 👉 specify file name to search
-execdir 👉 execute command from the subdirectory
cp from_file to_file 👉 copy from one file to another
{} 👉 is a placeholder for file that `find` will find
```

Don't stop here, learn more about these commands:  
[find](https://ss64.com/bash/find.html)
[cp](https://ss64.com/bash/cp.html)

With this little line, all files in the current folder and subfolders will be replaced.

After this research, I thought of another use case.
What if you need to rename the file?
The command is almost the same:

```bash
find . -print -type f -name apple.PNG -execdir mv {} orange.PNG \;
```

Hopefully, this will save you some time in the future when encountered in a similar case.  
Do you know any magic bash spells?
Coding Bootcamp – About to finish… or, about to start!
Tags: coding, bootcamp, begginers, webdev
Published: 2019-01-04 06:04:58

---
title: Coding Bootcamp – About to finish… or, about to start!
published: true
description: 
tags: #coding #bootcamp #begginers #webdev 
---
![alt](https://images.unsplash.com/photo-1531482615713-2afd69097998?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80
<h3>Coding Bootcamp</h3>)

I have had a busy time over the last five month trying to keep motivated not just to complete every single project the best I can, but to really understand what am I doing, time has fly and even though I am in the last weeks and about to complete the program, I am realizing that I am not about to finish but about to start.

**About to start**

… yes! About to start coding by myself without the support and instruction of my Instructors and TAs … about to start looking for a job position where I can apply what I have supposed to learn over this past months and the remaining of the time I will be in the bootcamp… just one more month that seems long as I feel physically (and mentally) tired … but at the same time it looks that is not enough time to start planning and completing my final project.

**About to finish**

Wow… 

I can not believe how quick the time went and I feel panic of thinking that I need to be ready to start doing things by myself while the end of the bootcamp approaches. I know, that once the bootcamp finishes I will need to pick up my notes, clean up my code, re-read assignments and re-do some others, read topic related books and blogs, and look for additional resources to keep myself learning.

I am happy I decided to start this journey and I am happy I did not give up when I felt overwhelmed because I learned a new set of skills that allows me to create . And, I did it in the best time of my life.
Coding Resolutions 2019
Tags: coding, webdev, codingresolutions, happynewyear2019
Published: 2019-01-04 05:55:24

---
title: Coding Resolutions 2019
published: true
description: 
tags: #coding #webdev #codingresolutions #happynewyear2019
---
![alt](https://images.unsplash.com/photo-1520316750891-270e081d94d8?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=858&q=80)

<h3>Happy New Year!!!</h3>

This year my resolutions are different than other years, this year I have coding and programming resolutions. Its is important for me because I feel I have not dedicated the time as I should, so this is a great time for me to reconsider and reorganize my daily activities, specially related to programming.

**1.Don’t be lazy**

Code more on my free(no-coding) time.

**2.Get more familiar with new programs**

Keep an eye and some practice in a new programming language, framework, or library – it always helps to get out of comfort zone.

**3.Patience…**

Be patient with myself when coding is not rendering as expected, look through the different variables, step by step, without hesitation. And, be patient with others that can require from your help since I have been blessed with more than user an additional pair of eyes over my code when it is not working as intended.

**4.Be aware of poor code practices and avoid them**

This is a resolution and a best practice that will save me from a non-working code.

**5.Network, mentor, and assist**

Is important to grow your network, you never know when you will need the help of someone in your field, mentor and assist others since it is not just a way to support others, but it will keep your skills refreshed and up-to-date.

That’s my 2019 coding resolutions and since I have a bad history of keeping resolutions, I will start with just five. 

I can do this. 

What are your resolutions? Happy New Year!
Day 0: Planning Phase
Tags: 301daysofcode, career, beginners
Published: 2019-01-04 05:45:00

---
title: Day 0: Planning Phase
published: true
description: A participation response to #301DaysofCode
tags: 301DaysofCode, career, beginners
cover_image: https://www.havi.com/sites/default/files/general/planning_subpage_banner_under_supply_chain_management.jpg
series: 301daysofcode_with_joross
---

###*2019 - new year, new goals.*###

Today, I am fully commiting myself to the #301DaysofCode to be competent enough and be a more awesome software developer. No more pro·cras·ti·na·tion, no more slacking, and definitely no more to sleeping for more than 10 hours a day.

With full of enthusiasm, this year will be completely different as i have setup goals that I want to achieve before 2020 comes. As a developer for 4+ years, I feel like a grinch slouching off just waiting for things to happen. But No! Ain't nobody got time for that! I will be more proactive this time and will be definitely make things happen.

My ultimate goal ever since starting in this industry is to be employed by one of those companies aligned in SILICON VALLEY *(you know what I meant)*. It will be a difficult task but nothing is difficult when you start from ground 0 till N-1. Being said, Ill work with opensource projects and start on making personal projects.

This is Day 0 of my #301DaysofCode. As I brainstorm what path will I go to while on this journey, I will be documenting every steps I take, every hurdles I face and every solutions I did. This is really exciting and I am very eager to start. I hope you stick on with me and be a part of this wonderful new journey of mine. Your support will really help me a lot.

 ![Beginning Quote](https://media.buzzle.com/media/images-en/gallery/quotes/506-starting-over-quote-one.jpg)
TIL: JavaScript replace() command with callback
Tags: javascript, todayilearned
Published: 2019-01-04 05:13:07

---
title: TIL: JavaScript replace() command with callback
published: true
description: 
tags: javascript, til
---

Of course, this is not new, it's already here centuries ago in the document https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace, but I never have to do any replacement complicated enough to use it, so I pay no attention to it until I read a pull request from a teammate today.

The `replace()` command in JavaScript has a callback that provided you with some more information such as the matched content, the index, and the original string. What you return in that callback will be replaced to the matched content.

This allows you to have a more complicated replacement, for example: you want to replace just the **second occurrence** of the letter `"a"` in `"abcabc"`to the letter `"$"`.

How would you write a regex for that? What if we change the requirement
to any **nth occurrence**? Even if you find a regex solution, is it
elegant enough to not making any other developer vomit when they had to maintain your code?

Using `replace()` with a callback, we can just write:

```
"abcabc".replace(/a/g, (matched, index, original) => {
  if (index !== 0) {
    return "$";
  } else {
    return matched;
  }
});
```

That's it, stop writing complicated regexes, start using `replace()`
with callbacks, it makes things easier. You and your teammates, all have a life to live, and sanity to save.
Why do you use your language/stack?
Tags: webdev, discuss
Published: 2019-01-04 03:31:46

---
title: Why do you use your language/stack?
published: true
description: This is meant to be a benign discussion about development stacks.
tags: webdev,discuss
---

# Where I am currently 🗺

When it comes to web development, I can't say I'm intermediate. I'm not that new to the industry either. But when it comes to what I should use, I sometimes flip between different things.

Currently, I'm a Laravel + Vue user. I started with PHP, tried Meteor🌠 due to a fantasy of using a single language on both front- and back-end, and ended up back with PHP on Laravel (but with Vue added in). Honestly, I may yet end up back in Node, depending on what I find to use it with.

But I'm wondering what stacks others use, and why they tend to stick with them.

# Preempting a flame war 🔥

I intentionally am *not* asking why you *wouldn't* use a different language or stack. I've come across plenty of arguments (that I tend to shy away from) over PHP vs. Rails vs. .NET w/ C#, and dynamic vs. strongly-typed languages. I'm of the belief that they not only all have their place, but that different languages and paradigms click better with different people. Personality and mentality always play a part in these kinds of decisions.

Regardless, I'm still curious about what draws others to their toolsets, and what types of projects they tend to work on with them.
Php using VSCode
Tags: vscode, php
Published: 2019-01-04 02:44:47

---
title: Php using VSCode
published: true
description: 
tags: VSCode, Php
---

I am learning Php and trying to get VSCode to Format and code complete my files. I have the Extensions recomended by VSC and have looked around but it seems that I have everything that they suggest. Is there a setting I am missing?
 The issue for me is when saving it doesn't format or tab anything properly.(Even when Formatting the file from menu) I do have that set to on_save in settings not on_type. It doesn't even have an auto complete for a Php block. 
Am I missing soemthing here? I set up my own snippet and that works but wondering why when you type <? VSC doesn't auto complete the rest. Any help would be awesome.

```
{

	"Php IF Statement": {
		"prefix": "pif",
		"body": [
			"<?php"
				"if ( $1 ) : ",
				" $2;",
				" endif;",
			"?>"
		],
}
```
Importance of Configuring Go sql.DB Connections
Tags: go, database, beginners
Published: 2019-01-04 02:41:15

---
title: Importance of Configuring Go sql.DB Connections
published: true
description: The obvious advice that I missed when switching from PHP to Go
tags: go, database, beginners
---
## Background

I've recently started to switch from PHP to Go and I missed something big (but now seems super obvious). My first go at technical blogging was a giant fail:
{% link aaronellington/go-sqldb-periodic-error-invalid-connection--35a %}

I wanted to loop back around and show what I've learned. I'm also hoping that this time I'm not missing anything as large.

## Issue

Coming from PHP, I'm used to scripts starting and stopping pretty frequently and the database connections that were opened would only stay open for a few seconds (max). But when I switched to Go, my scripts were running for days instead of seconds.

If more than about 15 minutes went by without a MySQL query being executed, the following attempt would fail with a `invalid connection` error. In my previous post, I found that calling a `db.Ping()` every 5 minutes "mostly" fixed my issue. But as many people kindly pointed out, this was not a good solution. I also still got errors from time to time, but not nearly as often.

## Solution (New!)
Not quite sure how I missed it the first time, but there is a `db.SetConnMaxLifetime` function. This allowed the sql package to handle how long connections can last before it will preemptively close them and reopen new ones. The default is to reuse them forever. The documentation puts it best:
```
$ go doc sql.DB.SetConnMaxLifetime
func (db *DB) SetConnMaxLifetime(d time.Duration)
    SetConnMaxLifetime sets the maximum amount of time a connection may be
    reused.

    Expired connections may be closed lazily before reuse.

    If d <= 0, connections are reused forever.
```

I worked with our database team to see how long before the MySQL server starts to kill idle connections and used my newfound `SetConnMaxLifetime` function to match the server. Since then, I have received near 0 connection errors over the past few months.

```go
package main

import (
	"database/sql"
	"time"

	_ "github.com/go-sql-driver/mysql"
)

func main() {
	db, _ := sql.Open("mysql", "user:password@/dbname")
	// Error handling omitted for this example
	db.SetConnMaxLifetime(time.Minute * 5)

	// Start the web server
}
```

## Final Thoughts
Although this now seems like a obvious concept, it did not when I first start with Go. Hopefully this can help someone else avoid the same mistake that I made.
Double Your Development Velocity without Growing Your Team
Tags: dx, product, productmanagement, developerexperience
Published: 2019-01-04 00:42:05

---
title: Double Your Development Velocity without Growing Your Team
published: true
description: This post explains how SendGrid implemented RICE prioritization framework within the DX team.
tags: DX, Product, Product Management, Developer Experience
---

The Developer Experience (DX) team at SendGrid is a small, but mighty force of two. We attempt to tackle every problem that we can get our hands on. This often means that some items get left behind. At the outset, we surveyed everything that was going on in our open source libraries and we quickly realized that we needed to find a way to prioritize what we were going to work on. Luckily, our team lives, organizationally, on the Product Management team, and we had just received a gentle nudge and training on the RICE prioritization framework. This post explains how SendGrid implemented RICE within the DX team.

https://medium.com/@mbernier/double-your-development-velocity-without-growing-your-team-bbea26355132

Written by Matt Bernier, former SendGrid DX Product Manager.
Containerize your Go application with Docker
Tags: go, docker
Published: 2019-04-02 10:33:29

---
title: Containerize your Go application with Docker
published: true
tags: Go, Docker
canonical_url: https://blog.merzlabs.com/posts/docker-go/
---

# Containerize your Go application with Docker

I am working on a small project with an API written in Go. After some time in development and testing was getting tired of building the binary and uploading it to a test server via SFTP, so I started to look for way putting the project in a container and deploying it with CI tools. More on the CI part in another post.

After some experiments I found that [Jess Frazelle](https://github.com/jessfraz) uses a Dockerfile like this for many projects with Go:

{% gist https://gist.github.com/NiklasMerz/d8c50ed27f3b0393b3d688234e4f77fd %}

I think this is a great and simple solution. It creates a builder container with the Go compiler and builds the binary which gets packed into a small container for deployment.
Day 3: Making a swift macOS password manager for people who hate the cloud
Tags: macos, swift, passwordmanager, cloud
Published: 2019-01-03 23:49:57

---
title: Day 3: Making a swift macOS password manager for people who hate the cloud
published: true
description: Watch as I make a password manager for macOS this month
tags: macos, swift, password manager, cloud
series: Making a swift MacOS password manager for people who hate the cloud
cover_image: https://thepracticaldev.s3.amazonaws.com/i/q6r73zbfbm3mpfs98bu5.jpg
canonical_url: https://streaking.app/posts/day-3-making-a-swift-macos-password-manager-for-people-who-hate-the-cloud-e825147b07a6
---

[<- For Day 2 go here](https://dev.to/swlkr/day-2-making-a-swift-macos-password-manager-for-people-who-hate-the-cloud-3h38)

My goal for today is to use the master password to unlock the app and show a blank screen where the list of passwords will be! Let's do it!

After quite a bit of searching around for various things like how to declare classes and then how to declare structs and then how to fill in a tableView and also how to switch the view controller in the window:

- https://docs.swift.org/swift-book/LanguageGuide/Properties.html
- https://stackoverflow.com/questions/44953830/swift-array-to-tableview-in-macos

I made some tangible progress!

![](https://thepracticaldev.s3.amazonaws.com/i/yux89xx7i7cs0j5s7n4x.gif)

Here's the code for checking the master password and showing a different view controller, the key for me was `self.view.window?.contentViewController = viewController`

```swift
    @IBAction func unlockButtonPressed(_ sender: NSButton) {
        let keychain = KeychainSwift()
        let masterPassword : String? = keychain.get("MasterPassword")

        if masterPassword == masterPasswordTextField.stringValue {
            let storyboard = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: Bundle.main)
            let viewController = storyboard.instantiateController(withIdentifier: "PasswordListViewController") as! NSViewController
            self.view.window?.contentViewController = viewController
        }
    }
```

I also messed around with the password list view, but I think that's something I'll have to get to tomorrow, I am still working a full time job after all

```swift
import Cocoa
import KeychainSwift

struct Login {
    let id: Int64
    let username: String?
    let email: String?
    let key: String
}

class PasswordListViewController: NSViewController {
    let logins = [Login]()

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override var representedObject: Any? {
        didSet {

        }
    }

    func numberOfRows(in tableView: NSTableView) -> Int {
        return logins.count
    }

    func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {
        return logins[row]
    }
}
```

Tune in tomorrow for Day 4 and actually adding passwords and showing them in that table view! There's going to be some rough and tumble SQLite action.
What was your last dev related Google Search?
Tags: discuss, productivity, beginners, career
Published: 2019-01-03 23:33:18

Ah, Google... Imagine a world of being a developer without you. Google and Stack Overflow are like my mom and dad helping me through my silly mistakes as a developer.

I'm not new either. I have been a developer for almost over 5 years now... and I am not afraid to admit that some of my Google searches would look silly.

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

I know, I am a horrible developer that has no idea what he is doing.

Wrong.

As a developer of 1 year to 20 years of experience. Getting a quick reference to something is arguably what our job is all about.

***Devs, what was your last dev related Google Search?***
A Survey: Why Developers Love Node.js
Tags: node, survey
Published: 2019-01-03 23:29:16

---
title: A Survey: Why Developers Love Node.js
published: true
description: 
tags: node, survey
---

Today I read [Why Developers Love Node.js & what's their main issue with it? Survey Results.](https://blog.risingstack.com/why-developers-love-node-js-2018-survey/).

It gives questions:

    What do you like most about developing with Node.js?
    What are you using Node.js for?
    What difficulties do you face with your production environment?
    What's the hardest thing for you to get right with Node.js at the moment?
    What Node.js topics are criminally underexplained in your opinion?
    Where do you deploy your Node.js applications?
    Which front-end technology do you plan to use in 2018?
    Which kind of databases do you plan to use in 2018?
    Which flavor of JavaScript do you use?

![](https://blog.risingstack.com/content/images/2018/02/what-do-you-like-about-developing-with-node-js--4.jpg)