teleren/devto huggingface dataset:
O perfil perfeito no GitHub
Tags: ptbr, github, git, perfil
Published: 2019-04-07 15:53:14

Vou dar algumas dicas de como criar um perfil apresentável no GitHub.

- Faça parte de comunidades open source e contribua para elas. Os melhores projetos para fazer contribuição são aqueles que você usar ou já está familiarizado com as ferramentas, pacotes, aplicativos e até mesmo jogos.
- Tenha repositórios organizados.
- Não uso o mesmo repositório para dois guarda dois projetos diferentes.
- Crie um README, ele tem que ter minimo a descrição do software e instruções para instalações e como fazer o seu uso.
- Tenha uma padrão universal de organização dos tópicos de seu README (Você vai usar eles em outros projetos como ponto de partida).
- Para repositórios com o arquivo "package.json", recomendo usar o Package-Json-to-Readme ou Gen-README como ponto de partida do README.
- Faça commits que descrever a modificação realizada (Nada como "Update X.js" ou "up").
- Escolha uma licença, o site escolhaumalicenca.com.br pode ajuda você nisso.
- Não coloque muitos arquivos na raiz, o ideal seria você usar subdiretórios para organizar os arquivos.
![](https://thepracticaldev.s3.amazonaws.com/i/4wk398r5f5eu1yda8v3l.png)
- Use os "badges" para mostrar status do projeto. Há vários desses no site shields.io.
![](https://thepracticaldev.s3.amazonaws.com/i/x8vxgu7ouaorzlljgbls.png)
- Sempre que possível crie testes.
- Use ferramentas de CI (Continuar integração), para fazer build e roda testes. Recomendo usar o Travis CI a integração dele com GitHub é perfeita e ainda tem "badges"
- Tenha um site para seu projeto, assim fica mais fácil de acha ele fora do GitHub. Caso não queira ter o trabalho de criar um do zero use o GitHub Pages.
- Separe seus forks em uma organização. Dica: Você pode manter eles sempre atualizados usar o bot [Pull](https://github.com/apps/pull).
- Não faça gambiarras :), lembre-se que o mundo todo vai ver seu código.
- Evite demorar muito responder issue ou pull requests.
- Tenha foto de perfil apresentável e uma rápida descrição.

Outras sugestões em [github.com/training-center/forum/issues/23](https://github.com/training-center/forum/issues/23).
Native Lazy Loading for <img> and <iframe> is Coming to the Web
Tags: news, webdev, html, discuss
Published: 2019-04-07 20:29:44

I'm really excited about the upcoming `loading` attribute in HTML.

```html
<img src="example.jpg" loading="lazy" alt="example" />
<iframe src="example.html" loading="lazy"></iframe>
```

Lazy loading in this case refers to delaying the loading of certain content until the user is near that content on a page. If they never scroll to the content, it is never loaded.

The loading attribute takes three possible arguments:

- lazy: Candidate for lazy loading.
- eager: Load right away.
- auto: This is the equivalent to not having the attribute.

You have probably seen lazy loading libraries which show a "preview" of an image before loading the whole image. In some ways, this is a really efficient way to deliver content on the web, but since this is done via JavaScript, it is kind of a hacky way to do things. I've never wanted to get JavaScript in between the user and the basic experience on the web.

This new attribute lets that happen without getting in the way.

It will be available in Chrome 75 and can be turned on already by visiting `chrome://flags`

![](https://cl.ly/b0d2671e0c31/Image%202019-04-07%20at%204.25.56%20PM.png)

More info:

## [Addy Osmani's post](https://addyosmani.com/blog/lazy-loading/)

## Specification PR:

{% github https://github.com/whatwg/html/pull/3752 %}

How do you feel about this?
Best DEV.to Posts for Beginners: Week of April 7, 2019
Tags: codenewbie, beginners, tutorial, bestofdev
Published: 2019-04-12 12:39:12

---
title: Best DEV.to Posts for Beginners: Week of April 7, 2019
published: true
description: From learning plans to tutorials, these are some of the best beginner posts of the week!
tags: #codenewbie, #beginner, #tutorial, #bestofdev
series: Best DEV.to Posts for Beginners
cover_image: https://thepracticaldev.s3.amazonaws.com/i/x9acs27zebb19v5rf8ml.png
---

One of the reasons I've been so drawn to DEV.to over other platforms is the super encouraging and helpful community that gathers here. Initially I felt like it was going to be more a place where I sat back and watched, rather than write and contribute, but I've been so pleased to find not only helpful articles and tutorials that I understand, but also that input from new coders and devs is well-received.

I thought it would be nice to compile some of the best posts every week for those of us who still identify as #codenewbies!

{% link https://dev.to/robertoissc/how-to-make-your-first-open-source-contribution-1k9h %}

I didn't set out to make my first open source pull request this week, but I live on Twitter, so when I [saw Jess mention that there was a typo on the DEV community moderation page](https://twitter.com/jessleenyc/status/1116438066321854464), in I dove.

{% link https://dev.to/danielharding/code-it-notes-create-your-own-1hj4 %}

Right now, I'm deep in trying to learn Javascript. These Code-It notes are exactly what I was looking for!

{% link https://dev.to/healeycodes/learn-the-storage-api-by-building-a-note-taking-app-6h5 %}

{% link https://dev.to/molly_struve/how-to-start-a-conversation-without-saying-a-word-4i8n %} 

Networking is hard and intimidating. I love this low-pressure way of being able to find people who look like you might have something in common with!

{% link https://dev.to/awwsmm/website-wireframing-advice-thread-4b8f %}

If you're looking for tips on wireframing best practices, or programs to use, this comment thread is rich with ideas.

## What were your favorite "newbie" posts this week?
Hello World!! This is a Junior Contributor
Tags: coding, contributing, community, opensource
Published: 2019-04-10 13:18:31

---
title: Hello World!! This is a Junior Contributor
published: true
description: This is a Junior speaking. What can I do to contribute to the coding community?
tags: coding, contributing, community, open-source
---

After 6 months of commercial experience as a Junior Developer and a coding bootcamp, I feel there is still a long path to ahead. I really love developers that share because it is a great way to learn. In this sense, although I'm not an expert, I feel I can still contribute to the community in some sort of way. 

![Hello World](https://thepracticaldev.s3.amazonaws.com/i/lh7t98w0dpglgb5q8afd.jpeg)

Since uni, I have been involved with startups which is where I have met incredible people. Individuals that want to create an impact in the world improving how things are done. I have been in different roles related to business, sales, growth, project management, product and I have always felt that coding is a key skill. A couple of years ago, it was my time to focus on it. I joined a bootcamp and just when I finished, I landed a job in an upscale startup. 

There is still a long journey and I'm doing great progress step by step. **I would appreciate feedback from people on what are the best ways to contributing**. Tips related to:
- Generating content: what sites or tips to take into account?
- Getting involved in open source projects.
- Other alternatives to consider.
React Native Create live Digital Clock using Local System Time
Tags: reactnative, android, ios, javascript
Published: 2019-05-29 05:54:09

---
title: React Native Create live Digital Clock using Local System Time
published: true
description: React Native Create live Digital Clock using Local System Time
tags: #reactnative #android #ios #js
---

Source : <a href="https://www.skptricks.com/2019/05/react-native-create-live-digital-clock-using-local-system-time.html" > React Native Create live Digital Clock using Local System Time</a>

This tutorial explains how to create live digital clock and get current system time using local system time in react native. You may have seen this feature in your android or ios mobile lock screen and here we are going create similar implementation to get current system time in digital clock.

<a href="https://www.skptricks.com/2019/05/react-native-create-live-digital-clock-using-local-system-time.html" >React Native Create live Digital Clock using Local System Time</a>


<img src="https://1.bp.blogspot.com/-gac-rfLXipc/XO4ciOGz-pI/AAAAAAAAC4Q/VQyAdKcvtjoM8s03Z1JhFEStIg2jqFnkQCLcBGAs/s400/react-native-create-live-digital-clock-using-local-system-time.jpg" />

<a href="https://www.skptricks.com/2019/05/react-native-create-live-digital-clock-using-local-system-time.html" > Click here to read more...</a>
The Best Coding Instagram Accounts
Tags: career, education, beginners
Published: 2019-05-29 13:41:10

---
title: The Best Coding Instagram Accounts
published: true
description: Instagram is becoming the next big thing in education. In addition to books, conferences, and Twitter, I use Instagram to get access to the content you won’t find anywhere else on the internet. The content is a mix of coding tips, good advice, and inspiring visuals. If you appreciate good photography and aesthetics, check out the list of 10 high-quality Instagram accounts that I follow.
tags: career, education, beginner
---

The list was updated in 2020.

Instagram is becoming the next big thing in education. In addition to [books](https://sizovs.net/2019/03/17/the-best-books-all-software-developers-must-read/), [conferences](https://sizovs.net/2019/03/21/the-best-developer-conferences/) and [Twitter](https://sizovs.net/2019/05/25/developers-to-follow-on-twitter/), I use Instagram to get access to the content you won't find anywhere else on the internet. The content is a mix of coding tips, good advice and inspiring visuals. If you appreciate good photography and aesthetics, check out a list of 10 high-quality Instagram accounts that I follow:



**[GO TO THE LIST](https://sizovs.net/2019/05/29/developers-to-follow-on-instagram/)**
Async/Await with React Lifecycle methods
Tags: javascript, react
Published: 2019-05-30 21:19:41

If you are like me you will also end up doing a lot of asynchronous work in componentWillMount/componentDidMount. This article will show you how to use Async/Await with React's Lifecycle events. React’s lifecycle methods can return any value, including a promise.

<!--more-->

## Promise Version

```js
componentDidMount() {
  fetch('https://example.com')
    .then((res) => res.json())
    .then((something) => this.setState({something}))
}
```

## Async/Await Version

```js
async componentDidMount() {
  const res = await fetch('https://example.com')
  const something = await res.json()

  this.setState({something})
}
```

_Note: if you do return a promise from the lifecycle methods it will be not be awaited._

I personally find the Async/Await version much easier to read.

## Full example (React Native)

```jsx
class AwesomeProject extends Component {
  state = {};

  setStateAsync(state) {
    return new Promise(resolve => {
      this.setState(state, resolve);
    });
  }

  async componentDidMount() {
    StatusBar.setNetworkActivityIndicatorVisible(true);

    const res = await fetch("https://api.ipify.org?format=json");
    const {ip} = await res.json();

    await this.setStateAsync({ipAddress: ip});

    StatusBar.setNetworkActivityIndicatorVisible(false);
  }

  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          My IP is {this.state.ipAddress || "Unknown"}
        </Text>
      </View>
    );
  }
}
```
Redux reimplemented in 12 lines of code
Tags: redux, javascript
Published: 2019-05-30 21:28:02

I like to reimplement libraries I use, this allows me to better understand how they work, below is my minimal implementation of Redux.

<!--more-->

```js
const createStore = reducer => {
  let onChange;
  let state = reducer(undefined, {});
  return {
    getState: () => state,
    subscribe: fn => (onChange = fn),
    dispatch: action => {
      state = reducer(state, action);
      onChange();
    }
  };
};
```

This works with the example on the Redux homepage below.

```js
const counter = (state = 0, action) => {
  switch (action.type) {
    case "INCREMENT":
      return state + 1;
    case "DECREMENT":
      return state - 1;
    default:
      return state;
  }
};

const store = createStore(counter);

store.subscribe(() => console.log(store.getState()));

store.dispatch({type: "INCREMENT"}); // 1
store.dispatch({type: "INCREMENT"}); // 2
store.dispatch({type: "DECREMENT"}); // 1
```

_Obviously this only has a fraction of the real Redux API._
Error first pattern for JavaScript Async/Await
Tags: javascript
Published: 2019-05-30 21:49:36

Dealing with errors is not fun. In this article, I will show you a pattern for dealing with errors in Async/Await. This pattern avoids the use of try/catch.

<!--more-->

```js
// Callback
fetch(URL, (error, response) => ...)

// Promise
fetch(URL).then((response) => ...).catch((error) => {})

// Async / await
try { fetch(URL) } catch (error) {}
```

Notice with callbacks you have no choice but to deal with the error, or at least feel guilty of not dealing with it.

## The problem

```js
async fetchData() {
    let json;

    try {
        const response = await fetch(URL)
        try {
             json = await response.json()
        } catch (error) {
             console.log("Parsing failed", error)
             return
        }
    } catch (error) {
        console.log("Request failed", error)
        return
    }

    const stars = json.stargazers_count
    this.setState({stars})
}
```

**Yuck**, I hope that disgusts you as it does me, exceptions should be exceptional, and there is nothing exceptional about connectivity issues on a mobile device, this is normal control flow.

> Go To Statement Considered Harmful  _(Edsger Dijkstra - 1968)_

I believe try / catch is a glorified Go To statement, execution stops and control jumps to the catch block. It should be used sparingly for exceptions not normal control flow.

So we have gone from explicate returned errors to throwing exceptions, this does not sound like progress.

## A possible solution

```js
async fetchData() {
    const [responseError, response] = await fetch(URL);

    if (responseError || !response) {
        console.log("Request failed", responseError)
        return
    }

    const [parseError, json] = await response.json()

    if (parseError || !json) {
        console.log("Request failed", parseError)
        return
    }

    const stars = json.stargazers_count
    this.setState({stars})
}
```

This uses array destructuring and since error is the first value it makes you think about handling errors. I’ve mixed Go error handling with NodeJS error first callbacks.

## Implementation details

```js
const errorFirstPromise = promise => {
  return new Promise(resolve => {
    return promise
      .then(result => {
        return resolve([null, result]);
      })
      .catch(error => {
        return resolve([error, null]);
      });
  });
};
```
Working with private repos in Docker
Tags: help
Published: 2019-05-31 09:39:45

Hello,

I am trying to work out an elegant way to build Node apps in Docker containers which use a private repo for its dependencies (JFrog artifactory) and a private Github repo.

*Artifactory*

I could just copy in my .npmrc but I am quite hessitant because it contains my authentication key.

*Github repo*

I could copy in my SSH-key but that seems like a big security risk.

What are your thoughts on this?
Thanks in advance!
Cheers
Configure Nginx Ingress Controller to use JSON log format 
Tags: kubernetes, nginx, devops, logging
Published: 2019-05-31 16:36:30

---
title: Configure Nginx Ingress Controller to use JSON log format 
published: true
description: 
tags: kubernetes,nginx,devops,logging
---

## Problem

I'm running Nginx Ingress Controller deployed on GKE and I want to structure my web server logs so I can create metrics and alerts in Google Cloud Stackdriver.

### References

* https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
* https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/

### Solution

If you are using GKE, there is already a Fluentd DaemonSet that forwards all container logs to Stackdriver.

All you need to do is ensure that Nginx Ingress Controller's ConfigMap has the following **log-format-upstream** settings:


```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-ingress-controller
  labels:
    app: nginx-ingress
data:
  log-format-escape-json: "true"
  log-format-upstream: '{"timestamp": "$time_iso8601", "requestID": "$req_id", "proxyUpstreamName":
    "$proxy_upstream_name", "proxyAlternativeUpstreamName": "$proxy_alternative_upstream_name","upstreamStatus":
    "$upstream_status", "upstreamAddr": "$upstream_addr","httpRequest":{"requestMethod":
    "$request_method", "requestUrl": "$host$request_uri", "status": $status,"requestSize":
    "$request_length", "responseSize": "$upstream_response_length", "userAgent": "$http_user_agent",
    "remoteIp": "$remote_addr", "referer": "$http_referer", "latency": "$upstream_response_time s",
    "protocol":"$server_protocol"}}'
```

If you are deploying Nginx using the [**Helm Chart**](https://github.com/helm/charts/tree/master/stable/nginx-ingress), the values file will look something like this:

```yaml
controller:
  config:
    log-format-escape-json: "true"
    log-format-upstream: '{"timestamp": "$time_iso8601", "requestID": "$req_id", "proxyUpstreamName":
    "$proxy_upstream_name", "proxyAlternativeUpstreamName": "$proxy_alternative_upstream_name","upstreamStatus":
    "$upstream_status", "upstreamAddr": "$upstream_addr","httpRequest":{"requestMethod":
    "$request_method", "requestUrl": "$host$request_uri", "status": $status,"requestSize":
    "$request_length", "responseSize": "$upstream_response_length", "userAgent": "$http_user_agent",
    "remoteIp": "$remote_addr", "referer": "$http_referer", "latency": "$upstream_response_time s",
    "protocol":"$server_protocol"}}'
```
Docker local dev environment for wordpress on mac
Tags: help
Published: 2019-06-01 03:18:34

---
title: Docker local dev environment for wordpress on mac
published: true
tags: help
---

I am new to dockers and struggling to create a local dev environment for wordpress on my mac (Production stage is already created on aws)

getting the follow error when I execute backup script 

Error: This does not seem to be a WordPress installation.

Struggling with setting up wpconfig.php for 3 different environment

anyone can help on this ?
Where do I go from here?
Tags: career, life, disability
Published: 2019-06-02 01:21:23

---
title: "Where do I go from here?"
published: true
description: "What do I do next in my life?"
tags: ["career", "life", "disability"]
---

So, I’m finding that I’m not particularly happy at my current job, but my various constraints make it very hard for me to find something else that would suit me better.

In particular, I have fibromyalgia which makes it difficult for me to do a huge amount of typing and, even moreso, limits what I can do in terms of oncall or crunch-type work. I’m also at a point in my career where I’m no longer enthusiastic about relearning everything under the sun for the flavor-of-the-week UI framework or whatever, and the chronic-pain brain fog makes it hard for me to juggle a bunch of external dependencies or manage other people.

I love programming and problem-solving from a “How do I do this difficult thing?” standpoint but the day-to-day of actually Getting Stuff Done is getting harder and harder for me to do. What are my options?

I definitely don’t have the right brain skills to be a manager, for example. And while architecting a new system from the ground up is absolutely in my wheelhouse, that's not really something that's a career path so much as the initiation of a new project — something you do when you're already established at a place.

I already tried the "do my own thing, try to make a career out of it" thing, for two years. While I got a lot of stuff done that I care about (particularly my [web publishing pet project](http://publ.beesbuzz.biz/) and [a bunch of games](https://fluffy.itch.io) and [music](https://sockpuppet.bandcamp.com), I never managed to turn any of it into a sustainable source of income. I have a decent amount of savings, but not enough to last me the rest of my life by any means.

I'm at a loss for what to do next. I'm in my early 40s, and I'm tired — *exhausted*, even — and burned out and disabled. I have so many things of my own that I want to make but I don't have the energy to do any of them, and I don't have the wherewithal to make them things that other people do either. I've worked hard all my life — harder than I should have been capable of, if anything — but now I feel completely spent and I don't know what to do.

There are many things I'd *love* to do and which I think I'd be good at, were it not for the issues my disability brings, but anything that puts me on a rigid schedule that can't accommodate how my body is doing from a day-to-day basis is an absolute no-go.

So, given that, does anyone have any ideas for what I possibly *can* do?

(As a note, please spare me any medical or ergonomics advice; I'm already working with doctors and trying to address the fibro issues as best I can. There is no one perfect cure for this poorly-understood condition, and if you haven't lived with this condition you *definitely* don't understand its implications on what I can or cannot do.)