teleren/devto huggingface dataset:
Microk8s: Unable to connect to the server: x509: certificate has expired or is not yet valid
Tags: kubernetes, microk8s, devops
Published: 2020-05-04 00:14:07

---
title: Microk8s: Unable to connect to the server: x509: certificate has expired or is not yet valid
published: true
description: How to solve microk8s cert rotation issue
tags: kubernetes, microk8s, devops
---
This is an error that you might see once every 10 years, so it's very likely you'll forget the solution.
The behavior is the following: When trying to do anything that interacts with API server you'll get the following error:
```
boris@ubuntu:~$ microk8s kubectl get all --all-namespaces
Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2020-05-03T23:53:06Z is after 2020-05-03T16:38:01Z
```

## How to solve it?
Easy, just renew your certificates. But first, it's a good idea to check expiration time of current installed certificates:
```
boris@ubuntu:~$ sudo microk8s.refresh-certs -c
The CA certificate will expire in 0 days.
```
Ok, we're a but out-of-date, let's renew them:
```
boris@ubuntu:~$ sudo microk8s.refresh-certs -i
Backing up certificates under /var/snap/microk8s/1385/var/log/ca-backup/
Creating new certificates
Signature ok
subject=/C=GB/ST=Canonical/L=Canonical/O=Canonical/OU=Canonical/CN=127.0.0.1
Getting CA Private Key
Signature ok
subject=/CN=front-proxy-client
Getting CA Private Key
1
Creating new kubeconfig file
Stopped.
Started.

The CA certificates have been replaced. Kubernetes will restart the pods of your workloads.
Any worker nodes you may have in your cluster need to be removed and re-joined to become aware of the new CA.
```
[SOLVED] ACF not saving data after WP 5 update
Tags: wordpress, acf
Published: 2020-05-04 00:10:37

If in doubt, duplicate your ACF Field group.

In all seriousness, this should solve any issues regarding not being able to save posts with nested ACF fields & repeaters. 

If this does not work. Try adjusting the WP DB table `wp_options` -> `option_name` to a lower version. This will trigger the ACF DB update if needed.

Cover image credits: [@steadyhandco](https://unsplash.com/@steadyhandco)
Build New York city blog with semantic html
Tags: html
Published: 2020-05-04 00:05:48

# [Demo](https://heggy231.github.io/chingu-webdev-speedrun-challenge/frontend/ny-blog/) 

## Navigation

Create "ul>li*3>a" for nav element

```html
    <nav>
      <ul>
        <li><a href="">Blog</a></li>
        <li><a href="">Media</a></li>
        <li><a href="">About</a></li>
      </ul>
    </nav>
     
```

## Section vs Article vs Aside

`<section>` is for separating contents.  `<article>` may stand alone.
`<aside>` complements supports article tag.


## media elements: `<video>`, `<audio>` are not self closing.  `<embed>` is self closing, just like `<img>`!   

`<video>`, `<audio>` tags remember to add controls attribute.


## Adding a img to enhance my blog site, add it after the section of the article.  

```html
      <figure>
        <img
          src="https://codecademy-content.s3.amazonaws.com/courses/Semantic+HTML/statue-of-liberty.jpeg"
          alt="statue of ny liberty"
        />
        <figcaption>
          This is the Statue of Liberty, a popular tourist attraction located on
          Ellis Island.
        </figcaption>
      </figure>
```

## For media, create its own section.  For audio media, there are two approaches.  Adding `src` or `<source>`.

```html

<audio controls src="example.mp3">
</audio>


<audio controls>
  <source src="example.mp3">
</audio>

```
Be Excitable
Tags: discuss, mentalhealth, wellbeing, watercooler
Published: 2020-05-22 14:20:02

---
title: Be Excitable
published: true
date: 2020-05-04 00:00:00 UTC
tags: discuss,mentalhealth,wellbeing,watercooler
canonical_url: https://coreydmccarty.dev/posts/2020_05_04_hobbies/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ukfu2l4gy1853sg43gu4.jpg
---

`All work and no play makes Jack a dull boy`

One of the biggest issues with getting older is that it's harder to make friends once you are out of school. When you have classes with someone then you automatically have something in common in being able to talk about the work that you are doing, and you are probably very close in age as well. Once you get away from school this becomes a bit less of a factor. Often times in software development people feel like they should be writing code 24/7 and while that is ONE possible way to spend your time, it isn't necessary. You need to unplug sometimes to prevent burn out and to keep from losing the enjoyment of programming. It is important to have things that you enjoy and motivate you forward. Hobbies are great for that.

```
Webster's 1913 dictionary:
Hob'by - n. 
...
3.	A subject or plan upon which one is constantly setting off; a favorite and ever-recurring theme of discourse, thought, or effort; that which occupies one's attention unduly, or to the weariness of others; a ruling passion.

```

So often growing up nerds are given a bad name, but what is a nerd really? A nerd is someone that enjoys something wholeheartedly. Whether it be comic books, video games, or sports the idea is the same. There is something that keeps them excited about life, and without something like that it is inevitable that you will burn out. Being able to unwind sufficiently will actually help you to work better. Leisure and work are both necessary, and mindlessly staring at whatever comes on channel 5 is not real leisure.

If you spend anytime at all on Reddit then you likely have found some hobbies that you didn't previously know existed. For me I've fallen into vaping (no cigarettes in five years now), traditional wet-shaving, mechanical keyboards, fountain pens, bullet journaling, blogging, and reading tabletop game stories. These all offer me something to spend time learning and thinking about. Hobbies teach us about things that lead to seeing the world with a different lens. This is really important as it allows us to provide something interesting to any team or relationship that we are a part of.

Whatever you do, remember to take time and enjoy life, and PLEASE let me know about your favorite hobbies (maybe even with links) in the discussion thread below. I'd love for us to help one another to find things to enjoy!

<a href="http://retrovectors.com">Cover image by retrovectors.com</a>
Monthly review: March and April
Published: 2020-05-05 05:38:48

---
title: Monthly review: March and April
published: true
date: 2020-05-04 00:00:00 UTC
tags: 
canonical_url: 
---

## Sponsors

I’m incredibly thankful to the following people for sponsoring my open source work this past month: [@repi](https://github.com/repi), [@oli-obk](https://github.com/oli-obk) and [@yaahc](https://github.com/yaahc).

If you like what I’m doing and want to support my work, please consider sponsoring me on [Patreon](https://www.patreon.com/philhansch) or [via other means](https://phansch.net/thanks) :heart:

## What I’ve worked on

You might have noticed that the review for March is missing. This was mostly a result of the still ongoing pandemic. I started working from home mid-March and it took me a few weeks to adjust. The following is what I’ve worked on in March and April combined:

- Clippy: [Improved output of `large_enum_variant` lint](https://github.com/rust-lang/rust-clippy/pull/5466)
- Clippy: [More usage of or patterns feature](https://github.com/rust-lang/rust-clippy/pull/5322)
- Clippy: [Removal of `matches` dependency](https://github.com/rust-lang/rust-clippy/pull/5370)
- Clippy: [More usage of diagnostic items](https://github.com/rust-lang/rust-clippy/pull/5509)
- Clippy: [Changelog for Rust 1.44](https://github.com/rust-lang/rust-clippy/pull/5498)
- Clippy: More code cleanups: [one](https://github.com/rust-lang/rust-clippy/pull/5452), [two](https://github.com/rust-lang/rust-clippy/pull/5458) and [three](https://github.com/rust-lang/rust-clippy/pull/5457)
- Tide/http-types: [Added various byte conversion methods](https://github.com/http-rs/http-types/pull/100)

I’ve also been trying to review more of the incoming pull requests which, at least for me, takes a lot of energy. Currently that’s around 15 minutes per day and one 1 hour timeslot per week for bigger PRs.

## Reflections

As mentioned above, I started working from home in March when the virus started to become an issue here. At the beginning I had a lot of trouble concentrating and getting a new daily routine in place. Things really only started getting better in April.

Towards the end of April I also decided to ditch touch typing with `dvorak`(after using it for 6 years) and learn touch typing on `qwerty` instead. This is currently slowing me down a lot:

[![qwerty stats](http://phansch.net/assets/images/posts/2020/qwerty.png)](/assets/images/posts/2020/qwerty.png)

It’s also incredibly frustrating because my brain slips back into `dvorak` every time I’m not 100% focused. Once I’m faster, I want to write about this switch a bit more.

## Goals

My primary goal for May is to reach 60+ WPM touch typing on `qwerty`. Another thing I want to work on is adding indicators to [Clippy’s lintdocumentation](https://rust-lang.github.io/rust-clippy/master/index.html) that highlight which lints can be automatically fixed using `cargo fix
--clippy` ([#4310](https://github.com/rust-lang/rust-clippy/issues/4310)).
CSS: currentColor Value
Tags: css, tutorial, beginners, webdev
Published: 2020-05-03 23:45:08

The CSS property `currentColor` is an interesting property where the value of `currentColor` is your element's current font colour. This value can be used as a named colour.

```css
div {
  color: red;
  border: 1px solid currentColor;
}
```

Like other CSS properties, `currentColor` is affected by cascade and specificity.

```html
<div>I'm Red</div>
<div class="div-blue">I'm Blue</div>
```

```css
div {
  color: red;
  border: 1px solid currentColor;
}

.div-blue {
  color: blue;
}
```

So what can we do with `currentColor`?

---

## SVG Fill

```css
a {
 color: blue;
}

a > svg {
  fill: currentColor;
}
```

## Theming

{% codepen https://codepen.io/koralarts/pen/GRpOdQN %}

---

Can you think of other ways to use `currentColor`?
Lições do Vôlei ao jogo da vida
Published: 2020-05-03 23:36:25

_Trasnformando Suor em Ouro_ é um livro escrito por Bernardo Rocha de Rezende, o renomado técnico da seleção brasileira, Bernardinho. O livro nos conta a sua trajetória desde de sua faculdade até as dificuldades que passou para obter os tão sonhados títulos mundiais.

O que chama atenção nesse livro não é apenas o quão impressionante a carreira de Bernardinho foi, mas como cada ideia fundamental de Bernardinho pode ser aplicada em nossa vida, independente da sua área ou carreira:

### Trabalho + Talento = Sucesso
Essa ideia parte do pressuposta que sem esforço é impossível realmente se destacar em algo. Não importa o que você esteja buscando, deve se prender aquilo obstinadamente e sempre se esforçar para melhorar. Seu sucesso não será definido pelo o que as pessoas dizem de você nem por um dom que você acredita não ter. Com o esforço necessário todos podemos nos tornar grandes líderes, dentro e fora do campo. A questão aqui é se você está disposto ou não a pagar o preço e lutar pelo que almeja.

### Você não pode estar limitado ao seu sucesso
Um dos fatores com maior potencial para destruir a ascenção profissional de uma pessoa é a zona de conforto. De maneira análoga, a única pessoa com real potencial para destruir sua carreira é você mesmo. Não devemos nos limitar a uma vitória - seja ela grande ou pequena - devemos estar sempre buscando mais, se nos esforçamos e superamos um desafio é sinal de que novos desafios maiores nos aguardam, e que consequentemente irão requerer mais esforço.

### Esforço coletivo é a chave para não se desgatar individualmente
Nunca tentar abraçar o mundo sozinho é uma das regras pela qual eu vivo. Tenho total ciência do esforço que faço para alcançar minhas metas e da mesma forma sei que sozinho, esse esforço é inútil. No final de uma partida de vôlei não importa quantos pontos um indivíduo fez, apenas o do seu time.

### A expectativa precede a frustração
Definir metas ousadas é uma ótima maneira de se forçar a aprimorar. Porém metas irreais apenas acarretam em frustração e desgaste emocional. Sempre saiba aonde quer chegar, mas ainda mais importante, como chegar, dessa forma você saberá os passos que deve executar e além disso, o que pode dar errado. Isso apenas dará mais clareza para a sua mente entender  o que e como deu errado, evitando a frustração desnecessária.


## Conclusão
Esse livro não é apenas uma lição para os esportes, mas uma lição para vida. Um exemplo claro, e firme de que com esforço é possível atingir qualquer objetivo. Bentinho é definitivamente um exemplo a ser lembrado pelos brasileiros e pelo mundo.
Every() and some() in javascript
Tags: javascript
Published: 2020-05-03 23:20:17

There are times when you get elements back in the form of an array, and need to check a condition for each element. I came upon the every() and some() methods that made it easier to make these checks. Let's take a look at some usecases. 

##Rotten fruits
We have a basket of fruits and we want to make sure that none of them are rotten. If we find even one fruit that's rotten, we want to throw out the basket(this is not always the case in real life, but let's just go with it).

For both of these methods, we need to pass in a callback function that has a condition to check against each element.
 
```js
let apples = ["fresh","fresh","fresh","rotten","fresh"]

const isRotten = apples.some(function(apple){
    return apple === "rotten"
})

console.log(isRotten)
//expected output: true
```

This is perfect for this scenario because the some() method short circuits as soon as it hits a truthy value, so finding the rotten apple in the bunch is a perfect use. 

But what if instead, we wanted to throw out only the rotten ones and keep the fresh ones? Some() wouldn't work here since it short circuits after the first truthy value. This is where every() comes in. Every() checks all the elements in the array and returns **true** if every element passes the condition. So in this new scenario, we are only throwing out the bag if every single apple is rotten.

```js
let apples1 = ["rotten","rotten","rotten","rotten","fresh"]

let apples2 = ["rotten","rotten","rotten","rotten","rotten"]

const isRotten1 = apples1.every(function(apple){
    return apple === "rotten"
})

const isRotten2 = apples2.every(function(apple){
    return apple === "rotten"
})

console.log(isRotten1)
//expected output: false

console.log(isRotten2)
//expected output: true

```

The first bag of apples has one fresh apple in it, making the bag salvageable and therefore "not rotten". The second bag however, has only rotten apples which output the true value.
Windows XP  Desktop screenshot - HTML&CSS
Tags: codepen
Published: 2020-05-03 22:54:27

<p>Windows XP status bar and start menu built with HTML and CSS. Hover over to see the screenshot. </p>

I need to make some improvements to the code, but overall my goal was achieved!

{% codepen https://codepen.io/elisoff/pen/yLYgoBe %}
Feeling morbid: How do you manage developer assets for a will?
Tags: discuss, watercooler, life
Published: 2020-05-03 22:01:39

---
title: Feeling morbid: How do you manage developer assets for a will?
published: true
description: Managing and planning developer assets for the afterlife. How do you keep a project alive once you're gone?
tags: discuss, watercooler, life
cover_image: https://up.imgix.net/library/2019/05/04/0605081-114.jpg?w=1000&h=400&fit=crop&crop=focalpoint&fp-y=.6
---

Knock on wood, but hopefully I have many years ahead of me yet. But this is a real and growing concern of mine, _What happens to my digital assets when I die?_

There are the digital photos, social media accounts, and etc. But for the sake of this conversation, let's focus on developer assets such as websites, respositories, account logins, etc.

The ego in most of us has some amount of desire to leave a legacy. For many it's their children. Not having any, with no indiciation that I will, I see a number of my web projects as my little babies. The ego in me would absolutely love to see them carry on after I perish. But how do I plan the succession of all the logins, databases, 3rd-party services, respositories, and servers?

### I would love to open a discussion with a few specific questions

1. What steps can be taken to ensure your websites and repositories continue to live on?
2. Do you have a will that addresses the handover of these assets?
3. Do you have people in your life you've asked to keep certain web/dev projects live?
4. Have you created additional documentation for a project to keep it live after you perish?

---

_I hope the photo isn't too morbird. It comes from [day 124](https://bugsy.me/sunrise/day-124) of photographing every sunrise of 2019._
3 Reasons Why GraphQL Can Be a Pain
Tags: graphql, webdev
Published: 2020-05-03 21:55:09

I love GraphQL but it’s not perfect. Here are the three main reasons why it can be a pain.

## 1. Extra layer of abstraction (more code)

We are adding more code by adding another abstraction layer for the database. We also need to invest time in tooling for both the front-end and back-end as well as learn up on the best practices such as API design and authorization. GraphQL takes more time and more lines of code and the end user will probably not notice the difference...is it worth it?

### Counterargument

GraphQL can actually reduce the amount of code written. Instead of managing custom routes, we just have to manage the graph API. Even if GraphQL results in more code and more time, it can actually save us time in the long run. By having a common query language that front-end and back-end can share, the team will be able to iterate faster.

## 2. Disregard of Traditional HTTP

GraphQL does not follow the rules of HTTP and status codes. For example, making a query in GraphQL is making a `POST` request with the query as the body. Oh and it's common practice to use `200` status code for all GraphQL requests and use the `errors` field to propagate any errors that have occurred. This means that we cannot use tools that were designed with the traditional web in mind.

### Counterargument

GraphQL is a new technology and it is unfair to write it off because it might be incompatible with tools made for traditional APIs. New technology requires new solutions, and the GraphQL community is continuing to develop tools to handle things such as caching, security, and monitoring.

## 3. Inefficient querying

While GraphQL is a dream for front-end engineers, it's very hard to optimize for back-end engineers. By allowing flexible queries, we are sacrificing optimization.

If we are comparing data fetching for a specific page, a highly optimized SQL query will be faster than querying the graph. While we can mitigate some inefficiencies of GraphQL by using tools to batch queries, it will always be inferior to an optimized query.

### Counterargument

GraphQL is not for every project. GraphQL was initially created to fetch information for network constrained devices. GraphQL allows the front-end to specify data requirements of an entire page and fetch just what it needs in one query. It depends on what we are optimizing for, GraphQL performs better than existing alternatives in certain dimensions.
Como fazer um Pull Request no Github
Tags: github
Published: 2020-05-03 21:48:09

Esse é um guia simples explicando como fazer um pull request.

Criado o projeto e clonado para a sua máquina, crie um branch novo para realizar a nova feature ou correção de bug.

```bash
git branch -b nova_branch
git checkout nova_branch
```

Feito a feature ou correção, crie um commit com a mensagem explicando a feature.

```bash
git commit -m "mensagem super explicativa ate 50 caracteres" 
```

Agora faça o push desse branch para o repositório do github.

```bash
git push origin nova_branch
```

Depois de dar o push nessa feature, volte para o branch master e apague a branch da feature nova.

```bash
git checkout master
git branch -d nova_branch
```
Beleza! Finalizamos o processo na nossa máquina.

Agora entre no repositório do projeto no site do github.

O github vai comparar o novo branch com o branch master e vai dar a opção de criar pull request da sua branch, feito isso coloque a mensagem do pull request, a mensagem deve explicar o motivo dessa nova funcionalidade ou o que levou a fazer essa correção de bug.

Se você estiver um time provavelmente terá algumas políticas para outros devs revisarem seu pull request, depois de revisado e aprovado seu código pode ir para produção sem medo de ser feliz.

Espero que tenha ajudado.
Codelots Technology Description! 
Published: 2020-05-03 21:38:45

We are a software development services company that employs cutting-edge and emerging technologies to help the client stay ahead of the competition. Clients choose Codelots Technology for the comprehensive range of application solutions and services, backed by a proven reputation for expert support and high quality.
Our IT services offerings spread across Software Application Development & Maintenance, Big Data, Business Intelligence & Analytics, Salesforce, IoT, Mobility, Cloud, DevOps, Blockchain, Firmware & Embedded System Development, and Independent Testing. Codelots Technology is focused on building its cutting edge practices and delivery excellence, we have been able to provide game-changing results for our customers by combining our industry experience with cutting-edge technologies. The company's solutions enable clients to maximize returns on minimum IT investment. We work with organizations around the world, in every industry, in the public and private sectors, and of every size, from start-ups to the big size companies.

Products and services
Software Development and Testing, Big Data, Business Intelligence, IoT, Mobility, Cloud, DevOps, Blockchain, Embedded System, Testing, etc..