teleren/devto huggingface dataset:
Laravel Erro: “Driver [] is not supported”
Tags: laravel
Published: 2021-08-10 22:48:20

Caso, aconteça o erro no Laravel `Driver [] is not supported` execute na pasta do Laravel:

```shell
php artisan config:clear
```

**Motivo:**
Quando é iniciado executado o Laravel no servidor ou na sua maquina, ele carrega as informações em cache inclusive do config/filesystem.php. Use o comando a cima para limpar as configurações carregadas.
Escenarios: La creación de APIs en la empresa
Tags: api, rest, http
Published: 2021-08-10 22:47:07

Entre mas pasa el tiempo se vuelve mas necesario entender los principios del desarrollo de #APIs (#REST/#HTTP).

Mira este escenario:
Tienes una base de datos local a la que le inyectas semanalmente los nuevos correos registrados pero esto es tan manual como descargar un archivo csv y ingresarlo a un #CRM que valida la existencia o no de los registros.

Dependiendo si es nuevo, si existe, si tiene error el procesa los envios masivos.

La mejora (considerando que se usa #WP u otro #CMS):
WordPress proporciona un acceso a los registros de nuevos suscriptores y este es validado con un token, y credenciales que fueron generadas por la API de WP de esta forma puedes gestionar con un API + #Middleware un gateway diseñado de forma local esta integración para extraer esos datos desde WP de automáticamente.

Esto se genera con una tarea en el CRM que extrae los datos desde nuestro API, este API hace un balanceo para no sobrecargar el servidor y nuestro middlware limpia los registros de espacios o caracteres o cadenas de texto maliciosas antes de llegar a su destino.

Ahora, este mismo API tiene un punto final donde el equipo de ventas puede ver el total de los nuevos registros procesados o nuevas personas que visualizaron la campaña o que interactuaron.

Lo genial, sí mañana ventas decide que su CRM no le es funcional solo debe apuntar el nuevo CRM hacia nuestra ruta (dentro de nuestro API local) y evitar tener que construir un nuevo módulo para extraer o inyectar estos datos.

Con la facilidad de que si usas un sistema replica (a nivel de VM/#Serverless/Cloud Computing) tu servicio en producción jamás se verá afectado tan sencillo como eso.
[Bugfix] depois de instalar node.js
Tags: node
Published: 2021-08-10 22:47:01

Estava fazendo alguns estudo de node.js e depois de alguns dias, fui instalar o pacote do Laravel para iniciar um projeto e ai me veio o erro:

```shell
gdakuzak@mac-air  newproject% composer global require laravel/installer
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicuio.64.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
zsh: abort composer global require laravel/installer
```

Como todo bom programador, eu olhei e pensei: mas que P@$#% é essa!!

Fui ao meu querido amigo do ❤️ chamado Google (Page e Brin, vocês são foda) e googlei.

O que é isso?
O que achei foi que o brew do não instala/usa “““““““““corretamente”””””””” as dependências da biblioteca icuio64. Então você precisa reinstalar os apps, “reinstalando” essas dependências, mas é simples o comando:

```shell
brew uses --installed icu4c | xargs brew reinstall
```

Preste atenção pois existem scripts de execução, após instalação de cada um dos Apps. Depois testei o composer de novo e foi.

```shell
gdakuzak@mac-air  newproject% composer global require laravel/installer
Using version ^3.1 for laravel/installer
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 20 installs, 0 updates, 0 removals
```

Bem, é isso!
Não se esqueça de lembrar!
Instalando Flask e validando
Tags: flask
Published: 2021-08-10 22:43:06

Estou fazendo um projeto na empresa na qual, preciso fazer um rebuild do código do Python puro para algum framework e meu chefe me apresentou o Flask.
Fiz um curso de Phyton avançado + Flask e já comecei a usar, mas pra começar a usar precisamos instalar, então vamos nós.

---
🚨🚨🚨🚨🚨🚨🚨🚨🚨
Observação importante!

Eu estou usando um Linux Mint 19.3, aonde eu tenho instalado também o Python 2, então precisei fazer um troubleshooting para sempre acessar o pip3 e o Python 3.

---

Bora lá!
---

— Instalar o Python 3.
```shell
sudo apt-get install python3
```

— ver qual versao está do python por default
```shell
python -V
# Resultado: Python 2.7.17
```

— Substituir por python3
```shell
ls -ltra /usr/bin/python
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3 /usr/bin/python
python -V
# Resultado: Python 3.6.9
```

— install pip
```shell
sudo apt install -y python3-pip
sudo ln -s /usr/bin/pip3 /usr/bin/pip
pip -V
# resultado: pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
```

— install venv
```shell
apt-get install python3-venv
apt show python3-venv
# resultado: Version: 3.6.7-1~18.04
```

— criando ambiente virtual
```shell
python -m venv <env>
```

— ativando ambiente
```shell
source <env>/bin/activate
```

— saindo do ambiente
```shell
deactivate
```

— instalando flask
```shell
source <env>/bin/activate
pip install Flask
```

Nesse ponto o Flask está instalado, porem precisamos testar!
Vamos criar um arquivo básico, para realizar o teste:

```python
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'
```

Na pasta aonde tiver o Flask, execute o comando:
```shell
python -m flask run
```

Acesse o link `http://127.0.0.1:5000/` e veja se aparece o resultado abaixo:

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yrxl0aykq7ugf2foet0c.png)

Pronto!
Tudo funcionando!
Fique a vontade para codar!
Laravel config – TZ Brasil
Tags: laravel
Published: 2021-08-10 22:35:15

Um dos primeiros procedimentos que eu faço quando começo a implementar num projeto do Laravel é o TimeZone. Além de ajudar na hora de ver o log (porque ficar convertendo toda hora é foda), salva os horários corretos e ajuda num possible throbleshooting.

Como fazer é fácil: vá ate no `config/app.php` e no parâmetro ‘timezone’, você troca:

Trocar: 
```php
'timezone' => 'UTC',
```

Por:
```php
'timezone' => 'America/Sao_Paulo',
```

e é somente isso!
Muito fácil né??
Export e Import Mysql/MariaDB
Published: 2021-08-10 22:32:39

###Export

Para fazer o export de um banco de dados em MySQL ou MariaDB, use o comando:

```shell 
mysqldump -u username -p database_name > data-dump.sql
```

Esse comando vai pedir a senha para fazer o backup e colocar na sua pasta corrente.

---

###Import

Para importar o `.sql` voce passa o comando mysql e a parte do comando `<` vai colocar os dados no comando mysql.

```shell
mysql -u username -p new_database < data-dump.sql
```
[Só Faz] Git Error: error: cannot lock ref 'branch_a': 'branch_b'; cannot create 'branch_a'
Published: 2021-08-10 22:13:22

##### "Só faz" são artigos que propõe as soluções mais rápidas, se você quer entender melhor, veja a seção "mais no bit"

**Seu erro é parecido com esse?**
```shell
error: cannot lock ref 'refs/remotes/origin/will_delete/feature': 'refs/remotes/origin/will_delete' exists; cannot create 'refs/remotes/origin/will_delete/feature'
From github.com:Rocketti/techcollege
 ! [new branch]      will_delete/feature -> origin/will_delete/feature  (unable to update local ref)
error: some local refs could not be updated; try running
 'git remote prune origin' to remove any old, conflicting branches
```
Então execute:
```shell
git fetch -p
ou
git remote prune origin
```

##### Mais no bit:
A primeiro momento: crio a branch vindo da main, normal e dou um push para que vai para a origin.

```shell
git checkout -b will_delete
git push --set-upstream origin will_delete
```

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyfaofu1bpw2maextrjg.png)

Lá no site da github, vou ver que a branch está lá, vou deleta-la e depois criar uma outra chamada will_delete/feature.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lit58nnv4veasxg5ah0i.png)

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k4inpqconkoagy9ihp2n.png)

Qual seria o caminho normal? Ir para o terminal e dar o pull, porém olhe o erro:

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qwt0p9ywizj26jb3celi.png)

**Qual motivo?**
Quando criei a branh will_delete/feature na web, não deletei localmente a will_delete que eu tinha criado lá no começo do processo e quando o git vai criar o fluxo para will_delete/feature ele da conflito porque will_delete ainda criado localmente.

**Como resolver?**
Use um dos dois comandos abaixo. Em ambos vão ativar o prune, aonde ele vai deletar localmente os repositórios que foram deletados da origin.

```shell
git fetch -p
ou
git remote prune origin 
```
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqb49jjvwdifwznilxhe.png)

Tá resolvido, rápido e simples.
Até a próxima galera!
React readux dispatch action
Published: 2021-08-10 21:51:42

Hi

I'm having a dispatch loadMovies using redux ,when first time I load the app.
Now when click over a movie,i will be redirected to movieDetails page. 

My question is , that when I redirect back to movies(home page ) the dispatch trigger again. Which mean i fetch the movies again , 
How could i fix this issue??
As i dont want it to be  dispatched and fetch the movies each time i redirected to home page.

Please help
Day 427 : Lessons to Learn
Tags: hiphop, code, coding, lifelongdev
Published: 2021-08-10 21:49:46

_liner notes_:
- Professional : Pretty full day. Had a couple of meetings. Worked on a demo to try and figure out what is happening with an SDK that being developed. Worked on the styling of some Web Components I created before. Been doing some research. I think I'm going to go with doing CSS parts to style the components. I've used CSS variables before, but I think I may use parts as a more straightforward approach to allowing the user to make the components look how they want, without having to know a bunch of variable names. We'll see how it goes.

- Personal : Spent last night working on getting the media server up and running. Good news is that I was able to stream from my phone to an instance of the Node Media Server deployed on Google Cloud. The thing was, that it's deployed to Compute Engine and not App Engine. Even though I was able to get the static IP address assigned to it, set up load balancers and even got HTTPs via a Google managed certificate, I think App Engine only allows for HTTP traffic, so I couldn't get streaming to it via RTMP working. So as a list ditch effort, I set up a Virtual Machine (the one on the free tier) and got the application deployed and running. So much research, reading docs, comment threads, guides, tutorials and watching videos! At the end, I was able to get it working. Awesome. Now, the thing is that it's not HTTPs only HTTP. Node Media Server had some documentation on configuring HTTPs, but it was using a self signed certificate which browsers don't like. I thought I would be able to do the same thing a with the App Engine deployment and use the load balancer and stuff. Nope! So now, I'm thinking I'll have follow the Node Media Server config docs, but use the certificate generated from a browser trusted source like Let's Encrypt. Thing is that it only lasts for 90 days and then need to be regenerated again. There is a way for it to be automatically renewed though. I've done it for my GitLab instance, but don't remember how I did it. It was such a long time ago and a different application. I'm sure things have changed since then. haha Guess I'll be diving back into yet even more docs and researching!

![View into a valley in Kalampaka, Greece with huge rock structures, a road and some buildings with more mountains in the distance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljpzeunstiig04xjf6fl.jpg)

The goal is to get the security certificate generated and linked to the application so I can start getting HTTPs working so other video players can play the stream. So many lessons to learn, but I really enjoy it. This is one of the main reasons I've always stuck with coding. Coming up with ways to solve problems. If I have time, maybe sneak in an Anime and go through tracks for the radio show.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube wZSQi1hYHGo %}
Dev log for Wonder Wanderer 2: Day 10 #LOWREZJAM 😁
Tags: challenge, devjournal, javascript, gamedev
Published: 2021-08-10 21:39:26

### What did I do today? ###
I finished all the hazards, so the game can be tomorrow on alpha state. Here is some tests:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uz40dae68duqkzqi5jne.gif)
<figcaption> Little tests for jumping through the walls. </figcaption>
You can in the game move in two ways (top down and sidescrolling), avoid spikes and holes, wrap through the screen, switch layouts, hop down to platforms, going to other rooms with their gravity. Here is an example of the reverse gravity, but I made a normal one, lighter, heavy, zero and reverse.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lpbaio1fbtm984cxuhjg.gif)
<figcaption> Example for a gameplay with Reverse gravity. </figcaption>
Setapp is an Independent App Store for macOS and iOS
Tags: tools, macos, ios
Published: 2021-09-01 22:27:23

---
title: Setapp is an Independent App Store for macOS and iOS
published: true
date: 2021-08-10 21:29:10 UTC
tags: tools,macOS,iOS
canonical_url: https://dils.blog/setapp/
---

 ![Setapp is an Independent App Store for macOS and iOS](https://dils.blog/content/images/2021/08/Setapp.png)

[Setapp](https://setapp.com/) is a subscription app store that gives you access to over 200 Mac and iOS apps. It's cheaper than paying for each app individually over a year.

I turn it on every few months when I want to clean up my Macs.

Some of my favorites on there are;

- [CleanMyMac X](https://cleanmymac.com/) - clean up unused files and caches.
- [BusyContacts](https://www.busymac.com/busycontacts/) - link to multiple services and organise your contacts.
- [Gemini](https://macpaw.com/gemini) - clean up duplicate files.
- [Renamer](https://renamer.com/) - obviously to rename files.
- [TablePlus](https://www.tableplus.io/) - manage multiple databases.

I'm a regular [ForkLift](https://binarynights.com/) user, which is a nice dual pane file manager. I've bought that separately so I don't have to be on the subscription all the time.

If you decide to sign up for Setapp consider using my [referral link](https://go.setapp.com/invite/dilantha).
What is Hashlib in Python?
Tags: python, programming, codenewbie, computerscience
Published: 2021-08-10 21:27:41

Hashlib is a Python module that implements an interface to different secure hash algorithms and digest algorithms. Hashlib is a secure hash and message digest algorithm library. 
Learn more here at https://www.alixaprodev.com/2021/08/how-to-use-hashlib-python.html
Meet Agrippa, the React CLI for component generation
Tags: react, javascript, webdev, showdev
Published: 2021-08-10 21:06:40

Finally, after over two years of writing the boilerplate of React components by hand, I'd decided to make snippets for them. However, I find myself working in quite a number of different environments (Typescript or JavaScript, different styling solutions, etc.), and it quickly became apparent that to accommodate for each and every reasonable combination, I'd be writing at least as much boilerplate as I'd sought to avoid.

To this end (as well as the desire to do something cool), I wrote a small CLI - [Agrippa](https://github.com/NitzanHen/agrippa).

As the documentation reads,

> "[Agrippa's] purpose is to assist React developers in creating components without the boilerplate. It can easily generate templates for React components of different compositions (styling solutions, prop validations, etc.) and in different environments."

Agrippa's leading features are:
🚀 **Ease of use** in both new and existing projects.
🐙 **Flexibility** - agrippa strives to be useful in many different circumstances.
🧠 **Smart defaults** - agrippa can detect and set defaults based on your environment's configuration, with no extra steps.
⚙️ **Configurability** - by using a plain old JSON file.

### Usage
To get started with Agrippa, install it using `npm i -g agrippa` (or `yarn global add agrippa`).
Once installed, components can be generated using `agrippa gen <name> [options]`! 

Some of the options supported by `agrippa gen` are:

- `--styling`: which styling solution to use (e.g. CSS, SCSS, JSS, Material-UI).
- `--props`: which prop validation/definition solution to use (e.g. Typescript interfaces, prop-types, JSDoc comments).
- `--children`: whether the components is meant to have children or not.

Also, Agrippa **automatically detects and sets** other, important defaults for you, such as whether to use **Typescript or Javascript**, and whether to **import React or not**.

An exhaustive list of options and defaults, as well as more information, can be found in the [GitHub repo](https://github.com/NitzanHen/agrippa#usage) or the [npm page](https://www.npmjs.com/package/agrippa).

### Community
My ambition is that Agrippa would become a tool that makes the lives of React developers easier, but perhaps more importantly one that they enjoy using. The tool's ease-of-use at the practical level is one aspect of that, but just as important is the cultivation of an active, positive community around it that developers feel welcome in.

Therefore, I invite you - yes, you - to become part of Agrippa's community. Your thoughts, suggestions and collaboration are most welcome.

Links: [GitHub](https://github.com/NitzanHen/agrippa), [npm](https://www.npmjs.com/package/agrippa).
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2021-08-10 21:05:13

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---
_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week._ 


## Clear design, clean projects

@fanniegunton created this guide for future clients after a poorly-planned project wrapped to make it better the next time around. Super helpful stuff in here!

{% link https://dev.to/fanniegunton/set-yourself-up-for-an-easier-development-project-1j61 %}

## The steps to change your mindset

Step 1: be aware of your attitude when working on something new. This and manny more mindset-shifting tips for tackling hard challenges via @tomeraitz.

{% link https://dev.to/tomeraitz/the-right-mindset-to-solve-complex-problems-1gc6 %}


## Accessibility is not a bolt-on

@clairebaire explains that when it comes to accessibility, sometimes, the standards aren't all we need.

{% link https://dev.to/clairebaire/why-can-t-we-solve-accessibility-with-a-one-line-script-tag-508f %}

## Learning new things is hard

@meganesulli is an experienced teacher in several different fields and they have some fantastic tips for learning more efficiently. Take a look 👀 

{% link https://dev.to/meganesulli/how-to-be-a-better-learner-421l %}

## No turning back

@bradstondev's story of staying the course to accomplish their dreams in software development. You don't want to miss this inspiring reflection.  

{% link https://dev.to/bradstondev/how-game-dev-and-betting-on-myself-altered-my-career-path-forever-17bn %}

## Learn computer architecture, become a better software engineer

This is a pretty convincing argument for learning computer architecture. Thanks, @voider!  

{% link https://dev.to/voider/why-everyone-software-engineer-should-learn-computer-architecture-2nb2 %}

## Be the driver and the passenger

@adiatiayu clearly breaks down the different elements of pair-programming based on past experiences. This read will inspire you to try out a new role in pair programming that you aren't as familiar with. 

{% link https://dev.to/adiatiayu/project-collaboration-and-pair-programming-4be6 %}



_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Tuesday!_
How to connect to SFTP with Golang using PEM and upload a file.
Tags: sftp, go, file
Published: 2021-08-10 19:48:34

Hi there!

Let's start reading the PEM file:

```go
	/// Read the PEM file.
	pemContentBytes, err := ioutil.ReadFile("google_reserve")
	if err != nil {
		log.Fatal(err)
	}

    password := "123456"

	/// Parse private key with passphrash
	signer, err := ssh.ParsePrivateKeyWithPassphrase(pemContentBytes, []byte(password))
	if err != nil {
		log.Fatalf("SSH PARSE PRIVATE KEY WITH PASSPHRASE FAILED:%v", err)
	}
```

We have `ssh signer` so next step is to set up the client with that signer. 

```go 

    username := "replace_with_sftp_username"
    sftpURL := "replace_with_sftp_url"

    clientConfig := &ssh.ClientConfig{
		User:           username,
		Auth:            []ssh.AuthMethod{ssh.PublicKeys(signer)},
		HostKeyCallback: ssh.InsecureIgnoreHostKey(),
	}

	conn, err := ssh.Dial("tcp", sftpURL, clientConfig)
	if err != nil {
		log.Fatalf("SSH DIAL FAILED:%v", err)
	}
	defer conn.Close()

```

Now we can start the client to work with the SFTP connection:

```go
	// Create new SFTP client
	sftpNewClient, err := sftp.NewClient(conn)
	if err != nil {
		log.Fatalf("SFTP NEW CLIENT FAILED:%v\n", err)
	}
	defer sftpNewClient.Close()
```

Below an example how to upload a file:

```go
    fileName := "replace_with_filename.extension"

    sourceFile, err := os.Open(fileName)
	if err != nil {
		return
	}
	defer sourceFile.Close()

	destinationFile, err := sftpNewClient.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC)
	if err != nil {
		log.Fatalf("OS OPEN FILE FAILED: %v\n", err)
	}
	defer destinationFile.Close()

	_, err = io.Copy(destinationFile, sourceFile)
	if err != nil {
		log.Fatalf("IO COPY FAILED: %v\n", err)
	}
```

It's done :)
Manually Install VScodium extension on linux
Tags: linux, vscode, opensource
Published: 2021-08-10 19:43:49

Visual Studio Code is a go to application for coder's because of its rich theme and extension base. It's open source edition VScodium is also very popular among developers.

If you have a network issue or CORS header error or simply you just want to install an extension offline then this guide is for you.
![VScode Extension Marketplace Error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o9v68ntskavfqxhl9pm5.png)

[Open VSX Registry](https://open-vsx.org/): A Vendor Neutral, Open Source Marketplace for VS Code Extensions. Where you can browse and download extensions. 
![Open VSX Registry Webpage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5jjc4fqqv42pyj0kpll.png)

For demonstration purpose I will install an extension called ***Prettier - Code formatter***

Lets search and open ***Prettier - Code formatter*** from https://open-vsx.org/

On the bottom right you'll find a **Download** button to download the extension file.
![Prettier - Code formatter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20olnwdjetjd4w68zuh8.png)

After download open terminal and change the directory where you saved the extension file. By default it will be in Downloads folder.
```
cd Downloads/
```

You can verify the file there or not through `ls` command
![ls command on linux](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/us0yik7uqw0kg7xqko8i.png)

If the file on that directory then simply run this command. You have to replace `<filename>` with the filename of the extension that you've downloaded.
```
code --install-extension <filename>.vsix
```

If the extension install successfully, you'll get output like this.
![VScodium extension install successfully](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r4179gu2o55ipb77vftw.png)