teleren/devto huggingface dataset:
What was your worst experience while mentoring a coworker? 💩
Tags: discuss, webdev, career, beginners
Published: 2020-01-23 12:31:17

<h4>Hello, users! 👋</h4>

Today I wanted to share one of the worst experiences I had teaching a coworker, I was his 'mentor' when he joined the team. I was so excited but... It turned out so **badly**.

<h2>Presentations</h2>

I'll call this guy **Davos**. Davos joined our team with an evident lack of english knowledge and conversation. (We were all spanish so we could communicate with him, but our entire work and documentation was writen in english).

Our team leader decided that I could teach him about the technologies we were using, the structure of the project and our team's philosophy.

I collected our team progress, wrote some guides, documentation, exercises and step-by-step guides for him (all in spanish of course)... Which he **totally ignored**.

<h2>The smelly Davos behaviour</h2>

Davos did **anything**.

I noticed he opened the guides/exercises when I was around but closed all up when I walked away.

In our progression meetings I saw he was doing nothing, still he didn't had "any doubts to ask". He started saying "that the techs we were using in our project sucked, that the techs he knew worked better". He tried to do some tasks with those "better techs of him" and failed, but still kept on using what he wanted.

My team leader told me to sit with him and actually **make him do something**. I tried, he totally ignored me, so I just gave him a simple task and opened a tab with the step-by-step doing of the task, then left. He closed the tab and then asked another male colleague how to do the task... This collegue opened the same tab I opened and explained the same thing I did. Davos told him: "WOW man, thank you! You rock!". I was speechless.

This happened twice. And a third time. And a fourth time. And so on. He was constantly avoiding and ignoring my explanations, closing the Chrome tabs of documentation that I opened for him when I was away, and asking the same thing to male colleagues... Which explained him the same things and opened the same docs.

As far as I saw I was loosing my time, because he only **listened** to male colleagues. So I told my team leader that I wouldn't deal with him anymore.

<h2>What finally happened</h2>

After 2 months, Davos mentorship finished. He pushed a corrupted version of our project with **+100 errors** and destroying our 6-months-work.

I'm thankful to god that the commits were reversible and we got back all our efforts.

Davos was finally fired because of so many reasons plus some of the mentioned above.

<h2>In conclusion</h2>

This was by far the worst experience I had while teaching someone at work.

After that I had all good experiences, but I always remember Davos and I feel his behaviour in many aspects was totally **out of any sense**.

What about you? Did you had a really bad experiencie while teaching/mentoring someone?
Utilizar "environment variables" no React fazendo build com Travis
Tags: react, travis, build
Published: 2020-01-23 12:26:27

Quando estiver utilizando environment variables (.env) em seu projeto React e o build estiver sendo feito através do [Travis](https://travis-ci.org), o arquivo .env não funcionará diretamente no servidor.

Para resolvermos esse problema devemos configurar em nosso Travis as "environment variables".

Primeiro devemos adicionar os dados que vamos usar no arquivo **.travis.yml**, como exemplo iremos adicionar REACT_APP_URL_API, onde, esta será a URL de consultas de nossa API.

OBS: É obrigatório que a constante tenha o prefixo **REACT_APP_**

```bash
env:
    REACT_APP_URL_API=${url_api}
```
Agora precisamos referenciar a variável **${url_api}** no Travis.

Devemos entre no Travis, selecionar o repositório do projeto, encontrar o menu **More options** e clicar em **Settings**.

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

Vá até a seção **Environment Variables** e insira a mesma descrição que prencheu no parâmetro acima, no nosso caso "url_api".

![Environment Variables](https://thepracticaldev.s3.amazonaws.com/i/97styf8mr8xkfm0vsxyc.png)

Após isso é somente fazer o build e direcionar para o servidor.

Para utilizar em nosso projeto utilizamos **process.env.REACT_APP_URL_API**
```js
import axios from 'axios';

const api = axios.create({
  baseURL: process.env.REACT_APP_URL_API
});

export default api;
```
How to get the user’s street address, using navigator.geolocation and MapQuest
Tags: api, axios, geolocation
Published: 2020-01-23 17:56:11

---
title: How to get the user’s street address, using navigator.geolocation and MapQuest
published: true
date: 2020-01-23 12:24:01 UTC
tags: API,Axios,geolocation
canonical_url: https://blog.jws.app/2020/how-to-get-the-users-street-address-using-navigator-geolocation-and-mapquest/
---

Let’s say that you have a webform where you are collecting a user’s street address.  You can save the user a few minutes by defaulting the value for them.  In this example, we are using [Vue.js](https://vuejs.org/), [Axios](https://github.com/axios/axios), [a MapQuest API](https://developer.mapquest.com), and [navigator.geolocation](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation) to first get the latitude and longitude from the client and then send it off to [MapQuest](mapquest.com) to get a physical address.

{% codepen https://codepen.io/steinbring/pen/dyyOoXy %}

[This example](https://codepen.io/steinbring/pen/dyyOoXy) builds off of our earlier [Axios / Vue.js 2 APIs 101](https://blog.jws.app/2020/axios-vue-js-2-apis-101/) post. But you will notice that there is a methods property, now. The this.geolocation() function is then kicked off within mounted().

Have a question or comment? Drop it in the comments and I will try to help.
Makers - Week 4
Tags: ruby, sinatra, postgres, sql
Published: 2020-01-23 12:19:08

So week 4 has come and gone, and somehow I am 1/3 of the way through my Makers journey! 

My initial thought was panic - time is running out, how am I a month in already, I have not learnt anything and there are only 8 weeks left! However on reflection, and looking over my current github repo - I quickly became aware of how much I have achieved in this short space in time.

This week was largely spent evolving last weeks Ruby/Sinatra 'MVC' style web app with the added function of a database! My app for the week (a snazzy 'Bookmark Manager') involved creating, reading, updating and deleting boomarks, all onto the database. This may seem thoroughly unimpressive from the outside, but I have to be honest - I bloody loved it!

This was the first time in this process I had a 'real-world' view of coding in practise. We quickly navigated through the primitive and archaic 'SQL' language, added the PostgreSQL functionality and tied it to our Ruby code via Sinatra.

On reflection of the week as a whole, I finally feel like my brain in getting up to speed, not just with the content, but also with the ability to learn again. And it is a fantastic feeling. This weekends challenge is a Twitter clone (aptly named 'Chitter') which dare I say I am looking forward to trying!

Saying all of this, next week is the famous Javascript week which looks to be soul crushingly hard. The rollercoaster continues!

As always, wish me luck!

David
Postgresql com Backup Incremental — parte 3 — Fazendo a limpeza de logs (pg_archivecleanup)
Tags: postgres, backup, database
Published: 2020-01-23 12:15:22

Para a limpeza dos logs antigos usaremos o comando pg_archivecleanup.

O pg_archivecleanup foi projetado para ser utilizado no archive_cleanup_command, após o recovery de um banco secundário. Mas como não estamos trabalhando com replicação, utilizamos de outra forma este comando, para facilitar criei um arquivo bash, onde verifico o último arquivo ".backup" da pasta de logs, e faço a exclusão a partir dele.

Os arquivos .backup contém os dados referentes aos processos do pg_basebackup, informando quais são os logs anteriores a execução.

O arquivo bash ficou com as seguintes linhas de comando:

```bash
DIR_LOGS='/var/lib/postgresql/pg_log_archive'
LAST_LOG=$(cd ${DIR_LOGS} ; ls -rt *.backup | tail -1)
/usr/lib/postgresql/9.3/bin/pg_archivecleanup "${DIR_LOGS}" "${LAST_LOG}"
```

onde,

**DIR_LOGS** é o local onde os logs (Wal) estão sendo gravados, e o **LAST_LOG** é o último arquivo .backup salvo, após o processo de pg_basebackup.

Ao executar o pg_archivecleanup, somente os logs (Wal), posteriores ao último basebackup continuam na pasta, com isso evitamos o acumulo de logs.

Em um banco onde se tem muitas transações, sem o devido cuidado com a exclusão dos logs, podemos ficar sem espaço em disco em pouco tempo, por isso é de grande importância esta rotina.
Postgresql com Backup Incremental — parte 2 — Fazendo backup do sistema de arquivos (pg_basebackup)
Tags: postgres, backup, database
Published: 2020-01-23 12:15:02

Continuando os procedimentos para realizar o Backup Incremental no Postgresql, neste post faremos o backup dos dados do servidor principal, onde este backup será usado posteriormente para o restore.

No servidor principal, vamos utilizar o comando [pg_basebackup](https://www.postgresql.org/docs/9.2/app-pgbasebackup.html), onde este comando faz o backup do cluster total do servidor principal, não sendo possível fazer o backup de somente um banco específico.

Executamos o comando abaixo:

```bash
pg_basebackup -h127.0.0.1 -U user_replication -D backup -Ft -z -P
```

os parâmetros utilizados pode sem verificados no site do [Postgresql](https://www.postgresql.org/docs/9.2/app-pgbasebackup.html).

Após a execução e conclusão, você pode verificar que foi criada uma pasta chamada backup a partir do diretório onde você executou o comando e dentro desta o arquivo base.tar.gz.
Postgresql com Backup Incremental — parte 1 — Configurando o registro de Logs (Wal)
Tags: postgres, backup, database
Published: 2020-01-23 12:14:40

Para realizar o backup incremental do Postgresql, utilizaremos o "Continuous Archiving", está técnica permite utilizar o PITR [(Point-in-Time Recovery)](https://en.wikipedia.org/wiki/Point-in-time_recovery), onde assim é possível realizar a cópia do WAL [(Write Ahead Log)](https://en.wikipedia.org/wiki/Write-ahead_logging) do PostgreSQL e utilizar estes logs para atualização de uma base de dados.

Para este tutorial estou utilizando o SO Ubuntu 14.04.

Primeiramente devemos alterar o arquivo **postgresql.conf**, adicionando os comandos abaixo:

```bash
wal_level = hot_standby
archive_mode = on
archive_command = 'test ! -f /var/lib/postgresql/pg_log_archive/%f && cp %p /var/lib/postgresql/pg_log_archive/%f'
max_wal_senders = 2
```

Após as modificações acima, devemos criar a pasta onde os logs serão salvos e dar permissão ao postgres para acesso da pasta.

```bash
mkdir /var/lib/postgresql/pg_log_archive 
chown -R postgres.postgres /var/lib/postgresql/pg_log_archive
chmod 700 /var/lib/postgresql/pg_log_archive/
```

Agora criaremos um usuário com privilégio de replicação:

```bash
su - postgres
psql -c "CREATE ROLE user_replication REPLICATION LOGIN PASSWORD '123';"
```

Após a criação do usuário "user_replication" devemos alterar o **pg_hba.conf**, adicionando a regra abaixo, assim, habilitando e permitindo a conexão para a replicação.

```bash
host replication user_replication 127.0.0.1/32 trust
```

Após as configurações, devemos fazer o restart do Postgresql.

```bash
/etc/init.d/postgresql restart
```

Agora seu servidor já esta configurado com o Continuous Archiving.
UptimeMate checks your website for uptime, speed and health 24/7.
Tags: startup, productivity, management, saas
Published: 2020-01-23 11:55:21

UptimeMate helps you to find technical issues on your websites and makes sure that you are the first to know.

Is your website online?
Checks from multiple locations worldwide. Send notifications to your team on slack and email.

Statistics about the loading time
Historical speed results, asset insights and tips to improve your loading times.

Check for errors
Detects 404 errors on your websites, checks SSL health and mixed content violations.

Join our Beta in March 2020
https://uptimemate.com/
Sitecore - Add custom button in Launchpad
Tags: sitecore, launchpad, button, howto
Published: 2020-01-23 11:42:50

<h4>Introduction </h4> Today I am going to show you how to add a custom launch button in the launchpad of Sitecore. It is quite straightforward for the Sitecore expert. If you find it so silly, you might skip this article.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/89wzdat5tysuoyye2nmj.gif)


<h4>Adding Launch Button </h4> Button and other core stuffs are part of Sitecore Core database. The easiest way is, go to "Content Editor" in core. I always use "sc_content=core" query string in Content Editor URL. 

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/l7hbqg09set2i5wq187o.JPG)

Go to <b> "/sitecore/client/Applications/Launchpad/PageSettings/Buttons/" </b>
You will see there is a group as below:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/3454p4minnotkna57su2.JPG)

Now, right click any of the groups and select "Insert - Launch-Button".
You can then fill the button item property as you need as below:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/d689f389lr6hjfcz1x3a.JPG)

<b>Text </b>: The text you want to display in the Launchpad button
<b>Open Icon </b>: You can select a icon from the thousands of icon options.
<b>Link </b>: You application link. If it's Sitecore Item, then you can use item path as shown in the image above
<b>Open in new tab </b>: If you want your application to be opened in a separate tab
<b>Open in frame </b>: If you want your application to be opened in a iframe.

That's all. Hope you now will create your own Launch button as discussed here. Let me know your thoughts

Arif
https://www.linkedin.com/in/mdarifuzzaman/
Explain C#.Net Like I'm Five
Tags: explainlikeimfive, csharp, dotnet
Published: 2020-01-23 11:29:11

What's the difference between C#.Net and just C# or .Net Core?

If I'm looking for a Full Stack Developer with C#.Net where C++ is a nice to have, would someone who has C# and C++ be able to pick up the .Net aspect very easily or would they need to learn .Net Core AND C#.Net?
Which podcast host should we use?
Tags: podcast, tutorial, productivity
Published: 2020-01-23 10:51:20

Choosing the right podcast hosting provider for your show is an important task.

So for that reason (based on our experience), we have covered everything from where to host your Podcast to monetize and grow subscribers of your podcast:

https://hostingpill.com/best-podcast-hosting/

Please suggest your findings by commenting!
BLOG! WHY BOTHER?
Published: 2020-01-23 10:50:55

Its been on my mind – for a few months now – to revive my interest in blogging and up my ante around this act. Given the hiatus, topic selection proved harder than I first thought. A few topics sifted through my mind as possible candidates, but my train of thought wandered through multiple paths, viewpoints, perspectives, all of which made me to question, “Why am I doing this”.

I wanted to take a step back and reflect, why I should be blogging and after spending the time and effort whether it would still have the same impact, as I thought/assumed it would. Times have changed, information consumption patterns have evolved, is traditional blogging one of the authentic distribution channels? What do I want to achieve? A few answers came

Over the years, I have acquired skills through my own experiences and I had like them to find expression.

I had like to argue a viewpoint and/or debate the pros and cons of multiple perspectives of a given story.

I want to reinforce my own knowledge on topics and figured that authentic writing is one of the ways to showcase expertise and in the process build my brand.

I want to build a community of like minded people, debate and bounce ideas off of them, kindred spirits having a lot in common.

I want to keep the experience educational and fun where my articles are a measure of my progress and concrete enough so that it helps others who are on a similar journey.

I had like to publish articles on topics like Digital Transformation, and Programming to start with.

When it comes to delivering an idea, I still believe a written blog is a good medium (compared to audio and video) because that text is searchable, less maintenance and less noise. However there are a plethora of platforms like medium, wordpress, linkedin, dev.to, and many others related to one’s niche skillset. I am not entirely clear on how to manage this other than to publish the same content on all relevant platforms.

It also feels unwise to ignore platforms like youtube, twitch, soundcloud, podcasts, etc… so I would experiment them based on the context of the content. Experimentation is the key and I should find the right balance in due course.

So whats next? I want to pick one topic and blog to the end of it. Narrowing down on one, is not something that comes easily to me, given my “generalist” nature (a blog topic by itself for another day). It may be tactful and practical to identify parts of my daily work and blog about my journey in accomplishing them. So stay tuned!
What parser do you use? What lib?
Tags: php, laravel, mysql
Published: 2020-01-23 10:34:44

Hey, dev community!


I want to parse jobs from different job boards like glassdoor, indeed and others and place them in mysql db for manual review by human and publishing on my job board.

What parser could you suggest for this kind of stuff? Php lib? Maybe there is a SAAS solution for this available?


Thx
How do I optimize WordPress for Google?
Tags: wordpress, productivity, speed
Published: 2020-01-23 09:48:10

<h2>Basics of WordPress SEO</h2>

SEO can get technical, but it doesn’t have to be. Just learning a few basic SEO tips to optimize your site can give you a noticeable boost in your website traffic.

You don’t have to be a tech genius to use the techniques below. If you’re already using WordPress, then you’ve got what it takes!

Let’s get started optimizing your website.
Check Your Site’s Visibility Settings

WordPress comes with a built-in option to hide your website from search engines. The purpose of this option is to give you time to work on your website before it’s ready to go public.

<h2>Using SEO Friendly URL Structures in WordPress</h2>

SEO friendly URLs contain words that clearly explain the content of the page, and they’re easy to read by both humans and search engines.

Some examples of SEO friendly URLs are:

     https://www.demo.com/seo-wordpress/

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/nuh24vb17zn4qype77m6.png)

<h2>The Best WordPress SEO plugin</h2>

When it comes to choosing the best WordPress SEO plugin, you will most likely narrow your choices down to the two most popular solutions: Yoast SEO or All in One SEO Pack.

<h2>Add XML Sitemaps in WordPress</h2>

An XML Sitemap is a specially formatted file that lists every single page on your website. This makes it easy for search engines to find all of your content.

<h2>Add Your Site to Google Search Console</h2>

Google Search Console, also known as Webmaster Tools, is a set of tools offered by Google to give website owners a look at how their content is seen by the search engine.

<h2>Optimizing Your Blog Posts for SEO</h2>

Often beginners make the mistake of thinking that installing and activating a WordPress SEO plugin is all what’s needed. SEO is an ongoing process that you must keep up with if you want to see maximum results.

<h2>WordPress SEO Best Practices</h2>

If you follow the basics of WordPress SEO and use the best WordPress SEO plugin, you will already be ahead of most websites.

<h2>Properly Using Categories and Tags in WordPress</h2>

WordPress allows you to sort your blog posts into categories and tags. This makes it easy for you to manage your content by topics, and for your users to find the content they’re looking for.

<h2>Tip and tricks</h2>
<ul><li>Make Internal Linking a Habit</li><li>Optimize WordPress Comments</li><li>NoFollow External Links in WordPress</li><li>Speed and Security for WordPress SEO</li><li>Optimizing Images in WordPress for SEO</li><li>Security and Safety of Your WordPress Site</li><li>Start Using SSL/HTTPS</li></ul>
custom hooksをグローバル変数みたいに扱わないで
Tags: react, javascript
Published: 2020-01-23 09:43:51

english: https://dev.to/origamium/don-t-use-custom-hooks-like-global-state-dda

はい、まずこのコードを見てください。

```js

const useInvalidHooks = () => {
  const [state, setState] = useState(false);
  const handler = useCallback(() => {
    setState(true);
  }, []);

  return [state, handler];
};

export default function ParentComponent() {
  const [state] = useInvalidHooks();
  console.log(`parent: ${state}`);
  return (
    <div>
      <InnerComponent />
    </div>
  );
}

function InnerComponent() {
  const [state, handler] = useInvalidHooks();
  console.log(`children: ${state}`);
  return <button onClick={handler}>hai</button>;
}

```

このとき、`InnerComponet`のbuttonを押下したさい、その親である`ParentComponent`で`state`の変更と更新を期待していると、ものの見事に打ちのめされます。変更されません。
経験豊かなReactエンジニアにはその理由はすぐわかると思います。

はい、理由は生成されたhooksは他のhooksの状態とは完全に別ですからです。私はこれに2時間ぐらい悩みましたが…
What's something you wish you knew when you first started to code?
Tags: webdev, productivity, beginners, discuss
Published: 2020-01-23 09:41:16

---
title: What's something you wish you knew when you first started to code?
published: true
description: 
tags: webdev, productivity, beginners, discuss
---

Don't we all had moments in our learning path, leading to self discernment "I wish someone would told me this before I started!" or "Learning would be so much easier onward if I first knew this!"?

To me, I wish I first knew how the request-> response cycle works, their methods, status codes and the overall process the page is being rendered.
 
Instead, I was just blindly typing html, css and js, without knowing nothing about what's actually happening under the hood. Stuff just 'magically' happened to me.

So, what about you? What did you learn the hard way?
Node js | Thread pool implementations
Tags: node, javascript, opensource, github
Published: 2020-01-23 09:33:27

I develop two thread pool on top on worker_threads that you can use with an high level API https://github.com/pioardi/poolifier .

This project contain two thread pool implementations :

The first implementation is a static thread pool , with a defined number of threads that are started at creation time and will be reused.

The second implementation is a dynamic thread pool with a number of threads started at creation time ( these threads will be always active and reused) and other threads created when the load will increase ( with an upper limit, these threads will be reused when active ), the new created threads will be stopped after a configurable period of inactivity.


I need your feedbacks and I would like your contribution on my project :)