teleren/devto huggingface dataset:
Issues migrating existing Oh My ZShell setup after a Catalina upgrade? I did!
Tags: catalina, node, bash, npm
Published: 2020-07-11 23:37:09

![Oh My ZShell Logo](https://ohmyz.sh/img/OMZLogo_BnW.png "Oh My ZShell")


Previously, I believe I had the newest OS at the time, Mojave. Was prompted to upgrade to Catalina and I am a freelancer with no one to ask permission so of course I upgraded (wouldn't you know Catalina now uses .zshrc instead of .bashrc (:  ). 

At first nothing worked. Then after hours of R&D (I tried soo many things to even list)... I just deleted Node/NPM and oh my ZShell. I tried a fresh install of both, and then everything seemed to work again (so far...not 100% convinced as my process/solution was so simple but that is usually how it goes anyways in the end...spend hours and hours to find a simple bug fix and/or one liner missing.... #devlife).

So yeah, I wasted an entire day on this wondering if it has to do with my $PATH etc or something else with Node and was going to use this post to ASK how to fix this, but instead it is now for those running into same issue!

So, just delete node/npm (I use homebrew...I suggest you do too for installing system packages/modules, works too consistently) and oh-my-zshell (which has a really cool command ==> `uninstall_oh_my_zsh`)

*Note: If the above command `uninstall_oh_my_zsh` is not found/simply does not work, this article may help find another way but if you don't have that command accessible you may have bigger issues. 

Reference this link if so https://askubuntu.com/questions/963874/uninstall-oh-my-zsh

Also, if your node versions are changing around due to this, you will get an error about a "sharp module" per chance and I do not know the technical specifics other than node versions are out of sync and all you need to do is one time before you build the FIRST time (unless node versions change again on system) run `npm rebuild` and it will get everything in sync and `npm run start` should work like gold. 

First post on here, so please any comments/feedback are encouraged.

Mike Schmerbeck
[mikeschmerbeck.com](https://mikeschmerbeck.com)

^^ minor issue with portfolio, will be resolved shortly! Was created a bit ago using jQuery, what do you expect? (;
   - Jedi React Engineer
Learning the Stack
Tags: beginners, javascript, computerscience, algorithms
Published: 2020-07-11 23:04:02

A stack is a data structure in which we only have access to the most recently added element. To best understand the stack I like to picture a pile of cards. Whenever we add to the pile of cards, we place one on the top of the pile. Whenever we remove a card, it also must come from the top of the pile. If we want a card in the middle of the stack. We would need to keep on removing from the top of the stack until we get the desired card. This concept is known as FILO, or first in last out.

![Stack example from wikipedia](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/Lifo_stack.png/350px-Lifo_stack.png)

As you noticed in the example image above. The main methods we will be using in a stack class are push and pop. With that in mind lets implement the stack class. Let's start with the constructor. We know we want to easily be able to add and remove the last element so an array is perfect.

![Stack constructor](https://dev-to-uploads.s3.amazonaws.com/i/cilc0dfzy0qljhu8vixs.png)

Javascript even provides us with push and pop methods for arrays. This makes implementing the push and pop methods incredibly easy.

![Push and pop methods](https://dev-to-uploads.s3.amazonaws.com/i/3amss99dmskhl7x1j92u.png)

But what if we were to try to use the pop method while the stack was empty? Let's add in some error handling.

![Error Handling](https://dev-to-uploads.s3.amazonaws.com/i/1zynlet2g3rx7g2h98rg.png)

Much better! Using a ternary we check to see if the stack is empty. If it is we return our error message, if it's not we pop off the top of the stack.

Some other common helper methods that could be added to a stack class are peek, where we look at the top element of the stack without removing it, is empty, where we check if the stack is empty, and a method that prints out the entirety of the current stack.

If you were looking for practice using a stack a perfect problem that can be solved by utilizing a stack is [valid parentheses](https://leetcode.com/problems/valid-parentheses/). Take a look at the problem and think about how a stack could be useful.

If you wanted to look at the code for this lesson the github link is [here](https://github.com/123JackCole/stacks).
Action Hero to the rescue! Creating least privilege AWS IAM policies
Tags: aws
Published: 2020-07-11 22:47:18

As developers start to build services and application, many will begin to use infrastructure as code tools such as Terraform, the serverless framework, SAM, or the CDK. All of these tools use the AWS SDK to make various API calls to AWS accounts. 

As the developer starts iterating on the needed configuration they usually begin with a highly privileged identity. This allows them to rapidly spin up the necessary resource without hitting permission road blocks.

When starting to create a more limited set of permissions to follow the principle of least privilege, things become a lot more painful. Starting with zero permissions a developer has to guess at what API calls are being made by the tool behind the scenes.

Enter Action Hero! By using a feature of the AWS SDK called [Client Side Monitoring](https://summitroute.com/blog/2020/05/25/client_side_monitoring/), Action hero is able to display the API calls being made by the developer's tool of choice. 

You can find the latest version of action hero [here](https://github.com/princespaghetti/actionhero/releases)

Once you've downloaded the release you can use tar or another archiving tool to extract it. On Linux and Mac you may have to also run ``chmod +x <path to actionhero>`` to allow it to be executed.

Once extracted, you can run the executable. You should see something similar to the screenshot below 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vx3yak7o7w78m1pltwd7.PNG)

In another tab, we'll enable Client Side Monitoring (CSM) by exporting an environment variable (The set executable can be used on windows). The CSM feature is not enabled by default.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/foztx5vwe68ye57k4nb1.PNG)

Finally we can use a tool which leverages the AWS SDK. This assumes you already have valid credentials for an AWS Account. Please see the [documentation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/configure/index.html) if you need assistance.

In this screenshot I've run the ``aws s3 ls`` command which uses the AWS CLI to list the buckets in my account.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/q8ksk14819zf0r0xdt24.PNG)

If we switch back to action hero's tab we can see the API call that occurred.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ypoxc5y5n7uv9ydtzmtl.PNG)

Finally you can press ``Ctrl+C`` to exit action hero. 

I hope you find action hero useful as you build on AWS and create least privilege identities!
PNPM Package Manager
Tags: node, npm, yarn
Published: 2020-07-11 22:33:31

Estava lendo as atualizações do VSCode e achei isso:

![pnpn-vscode-news](https://dev-to-uploads.s3.amazonaws.com/i/1r9380kw0ufqqbj2ze0k.png)

[PNPM](https://github.com/pnpm/pnpm) é um gerenciador de pacotes como o [npm](https://www.npmjs.com/) e [yarn](https://yarnpkg.com), mas com a grande vantagem de usar um sistema de arquivos endereçável por conteúdo, compartilhando os arquivos entre projetos e entre diferentes versões do pacote.

![pnpm-github](https://dev-to-uploads.s3.amazonaws.com/i/w4tpdcsyc8j5dwcit3vv.png)
I switched to OpenSuse
Tags: discuss, linux
Published: 2020-07-11 22:22:44

---
title: I switched to OpenSuse
published: true
description: I switched away from Debian on my server to OpenSuse
tags:
  - discuss
  - linux
//cover_image: https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/OpenSUSE_Logo.svg/128px-OpenSUSE_Logo.svg.png
---

So, after the news that SUSE purchased Rancher, I figured I would give them another go mostly because I love `k3s` almost as much as I love `kind`.

Is there anyone else to thought the same thing?

Is there anything else that made you make a hard OS switch like this?
O projeto Programador Cansado
Tags: ptbr, mentalhealth, braziliandevs
Published: 2020-07-11 22:21:01

Eu acabei tendo a ideia de criar uma organização no Github para agrupar informações sobre saúde mental. O nome do projeto é [Programador Cansado](https://programador-cansado.github.io/), o objetivo é dedicar uma atenção para a mente e a sua saúde no contexto da programação.

Eu tive algumas experiências pessoais que me atrapalharam na construção de uma carreira estável, esse projeto é uma tentativa de tentar criar algo construtivo a partir do meu fracasso pessoal ligado a sáude mental e esgotamento trabalhando com programação (por falta de autopreservação).

A ideia base do projeto é a seguinte: **antes de cuidar do código-fonte, é importante cuidar da mente, caso contrário, ela vai bugar mais que o código-fonte.** 

### O Objetivo de forma sintetizada

O objetivo do projeto pode ser descrito com as seguintes palavras: **cuidando da saúde mental (para a mente não bugar).**
Enviar correo con Gmail-Relay
Tags: relay, gmail, docker, laravel
Published: 2020-07-11 22:02:38

Escenario: 
Aplicación corriendo dentro de la intranet sin acceso de salida a internet en forma directa.
La aplicación requiere enviar correo usando una cuenta gmail. 
El puerto 465 es inaccesible desde el server. 
Tengo un servidor con varios dockers corriendo en una ip a la que si puedo acceder desde la aplicación. 
Búsqueda en google me entrega varias alternativas como usar algunas reglas de iptables, un binario que hace de relay pero también un docker que hace todo el trabajo. 
https://hub.docker.com/r/namshi/smtp/

Permite correr en una instancia de docker un relay que envía todo el correo que recibe utilizando una cuenta de gmail. 
Algo que simplifica todo en una línea de docker o con docker-compose. 

{% gist https://gist.github.com/horaciod/c12b1cbc4d8e3d76d803615f1908a5e3 %}
 
Luego solo falta colocar en el archivo .env de laravel lo necesario para apuntar al nuevo relay smtp.
MAILER_HOST= IP-del-server-docker
MAILER_PORT=25 (PUERTO EXPUESTO)

Et voilá todo funcionando. 
Usando docker-compose log -f podemos ver el log del relay funcionando
#033 Kubernetes - Pods lab 3
Tags: kubernetes, devops, tutorial
Published: 2020-07-11 21:39:45

# Introduction

this is part 33 from the journey it's a long journey(360 day) so go please check previous parts , and if you need to walk in the journey with me please make sure to follow because I may post more than once in 1 Day but surely I will post daily at least one 😍.

And I will cover lot of tools as we move on.
***

# Lab
In last lecture we use the Imperative method , now we need to use the declarative method.
yaml is really important for devops we use it in docker but we did not understand what it is or how it's really work , so it will be good also to cover it somewhere in this journey.

![yml](https://dev-to-uploads.s3.amazonaws.com/i/eg5h7w358q1wmu3s3azn.png)

this is the yml file for a pod , it's on my github account you can access it [on this link](https://github.com/OmarElKhatibCS/DevOpsJourney/blob/master/app_033/app_033.yml) or if you follow me on docker parts so you already have DevOps folder just pull it.

let's back to the the file and break it to parts :

1. apiVersion: Defines what version is used to create the Kubernetes Object.
2. kind: Defines what object needs to be created in our example it's a single pod. We have name of first-api-dec if you remember in last part we call it first-api.
3. metadata: You can add data here that helps uniquely identify objects in the Kubernetes cluster like name, type, etc.
4. spec: This is the most important where you describe the description of the characteristics you want the resource to have, its desired state, etc.

![get-pods](https://dev-to-uploads.s3.amazonaws.com/i/fikgxk0tmo64tj401mpt.png)

```bash
kubectl get pods
```
this is the old pod is have an error I can fix it but no need to it in this part so why bother :p
we need to create our new pod from this yml file
![create](https://dev-to-uploads.s3.amazonaws.com/i/h7fphi1o5rb6tn5znrg2.png)
```bash
kubectl create -f ./app_033.yml
```
because I am in same folder as file I can access it using ./app_033.yml so if you are in DevOpsJourney folder you should write ./app_033/app_033.yml
![get-pods2](https://dev-to-uploads.s3.amazonaws.com/i/mp0kb6dto12wfkrhezr3.png)

```bash
kubectl get pods
```

we can see we have our new pod is running and we see it take the name that we give it first-api-dec in the yml file.
javascript combine few functions into pipeline
Tags: javascript, node, compose, pipe
Published: 2020-07-11 20:58:35

#**combine few functions into pipeline**

sometimes we need to pass our data in some pipe line that will produce the updated data 

and its can be accomplished in many ways

the simplesd way is that
```scala
const obj = { name: "itay", age: 28, isValid: null }

const upperCase = (({ name, ...other }) => ({ ...other, name: name.toUpperCase() }))
const setAge = (({ age, ...other }) => ({ ...other, age: (new Date().getFullYear() - age) }))
const validName = (({ isValid, name, ...other }) => ({ ...other, name, isValid: name.match(/^[A-Za-z]+$/) ? true : false }))
const func1res = upperCase(obj)
const func2res = setAge(func1res)
const func3res = validName(func2res)
console.log(func3res)

```
yes its working 
but its not the best way 

we can combine all the funtions into one line like that 
```scala
console.log(validName(setAge(upperCase(obj))))
```




but its will become harder to maintain in that way
there is another option 
slightly different
#**reducers**
reducer is an method that belong to array object
and its can help us to combine those funtions

i assume that you already know that is an reducer 
and if not i will show a little example that sum the number in the array

```scala
var numbers = [1, 2, 3, 4];
const sum2Numbers = (accumulator, currentNum) => currentNum + accumulator


console.log(numbers.reduce(sum2Numbers, 0))
```

 this is how we combine the functions with reducer

```scala
const compose = (arr, val) => arr.reduce((updatedObj, currentFunc) => currentFunc(updatedObj), val)
```2

its will get the same result 
{ age: 1992, name: 'ITAY', isValid: true }


to explain this i will use a difrent example 
 we have 2 function 2415
```scala
const doubleit = (a) => a * a
const addit = (a) => a + a
```
we want a way to combine thoes funcs with minimum effort 
lets begin 

first we create function that run on every function and every time get the last calculated value 
```scala
const combineFumc = (value, currentFunc) => currentFunc(value)
// like the sum2Numbers , in runtime its will be something like
(value, currentFunc) => currentFunc(value)
(2, doubleit ) => doubleit (2)
```

then we create the compose function 
```scala
const coompose = (functionList) => (val) => functionList.reduce(combineFumc, val)
```
the first value will be an array
```scala
const additTwiceAndDoubleif = coompose([addit, addit, doubleit, doubleit])
```
so you can decide how do you want to combine your function

and then you just pass to the function the value to calculate 
```scala
 console.log(additTwiceAndDoubleif(2))
```
How to ship static assets with your React Native library
Tags: react, native, fonts
Published: 2020-07-11 20:45:23

---
title: How to ship static assets with your React Native library
published: true
description: Learn how to add fonts or other assets to your package so they can be utilized by projects consuming your library.
tags: React, Native, Fonts
cover_image: https://i.imgur.com/emUrw2p.png
---

# Background

Work on React Native is moving at an incredible. Incredible, fresh features are being shipped regularly with more and more large tech companies pitching in.

One issue with the speed of this development, however, is that things change pretty rapidly. You might find conflicting answers to a problem you run into and you'll need to suss out which one is the most modern/correct solution. This is the situation I found myself in when I was trying to find the best way to ship some font files ([Plex](https://ibm.com/plex)) with the component library I'm working on ([Carbon](https://www.carbondesignsystem.com)).

# The Solution
1. Create an `assets` (or call it whatever you like) directory with your font files/static assets the root of your project. You can also throw it under `src` or somewhere else, you'll just need to update the path in the next step.

1. Also in the root of your package add a `react-native.config.js` file with the following:

```js
// react-native-config.js
module.exports = {
  dependency: {
    assets: ['assets'], // or whatever your directory is
  },
};
```

1. After installing your package, developers will just need to run `npx react-native link my-special-package` in the root of their project (replacing `my-special-package` with the name of your library). Update your docs to add this step accordingly.

1. React native will update the corresponding native files in their projects and allow them to be referenced accordingly.

# Wrap up/caveats
This felt really clean solution and allowed me to keep working on my package. The dependent package I used was generated using `@react-native-community/cli`, I haven't experimented with an expo package just yet.

I'd love to here how other folks have dealt with this or other React Native problems.

# Resources
- [react-native-community/bob](https://github.com/react-native-community/bob)
Essential tool for packaging React Native modules for publishing
- [React Native — Monorepos & Code Sharing](https://engineering.brigad.co/react-native-monorepos-code-sharing-f6c08172b417)
Great medium article for setting up React Native in a monorepo
- [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons)
Awesome library that loads assets in a variety of ways. They need to support older React Native versions, so you'll see a few different techniques employed to load their fonts.
Hoisting in JavaScript
Tags: javascript, codenewbie, beginners
Published: 2020-07-11 19:42:43

## What is hoisting?

Hoisting in JavaScript allows you to access variables and functions before they are created.

### Function Hoisting

```javascript
console.log(helloWorld()); // Hello World
console.log(multiplyNumbers(10, 5)); // 50

function helloWorld() {
    return "Hello World";
}

function multiplyNumbers(a, b) {
    return a * b;
}
```

You can see that I had used both the functions before they were declared, and JavaScript had no issues. It console logged the results as expected. It is a good practice to declare the functions prior to using them.

### Variable Hoisting

```javascript
console.log(age); // undefined
console.log(foo); // Reference Error: foo is not defined

var age = 10;
```

I was able to use the variable `age` before it being declared. It did log `undefined,` but it did not throw an error. If you compare it to the log of variable `foo,` you would see that the statement throws an error.


### Caveat of Hoisting
Why did it not log the value of the variable `age`?

> Hoisting supports variable and function **declarations only**.

So when javascript hoists variables or functions, it takes the declaration to the top of the file. It does not, however, take the definition or the value assigned. So in the example of `age,` it hoisted the variable but not the value assigned to it.

Due to the principle of hoisting decelerations only, you would not have been able to use the example provided in function hoisting, if I used function expressions.

```javascript
console.log(helloWorld()); // helloWorld is not defined
console.log(multiplyNumbers(10, 5));

const helloWorld = function () {
    return "Hello World";
}

const multiplyNumbers = function (a, b) {
    return a * b;
}
```
javascript - how to pass array into chain of functions
Tags: javascript, node, array, chain
Published: 2020-07-11 19:39:23

#**chain functions**


lets asume that we have an array of object
and you want to make few operation on the array like 
filter , map , sort 
so one option will be straightforward
run each time on every operation 

```scala
const arr = [{ name: itay, age: 10 }, { name: sam, age: 20 }, { name: jett, age: 30 }, { name: bob, age: 40 }]


//filter  the obkect with age under 10
const filtering = ({ age }) => age > 10
filterdArr = arr.filter(filtering)

// abount the sorting - if the function return negetive value then a will be befora b
//and if the funtion  return positive number then b will be before a 
const sorting = (a, b) => a.age - b.age
sortedArr = filterdArr.sort(sorting)

//refactor the object , changed age to myAge
const mapping = ({ name, age }) => ({ name, myAge: age })
mapedArr = sortedArr.map(mapping)

console.log(mapedArr)


```
the second option will be to chain the funtions 
like that 

```scala
console.log(
    arr.filter(filtering)
        .sort(sorting)
        .map(mapping))

```
and the result will be the same 
[
  { name: 'jett', myAge: 30 },
  { name: 'bob', myAge: 40 },
  { name: 'sam', myAge: 55 }
]
What is the process to configure the Netgear Extender Via Mywifiext.local Setup
Tags: mywifiext, netgearextendersetup, mywifiextsetup, mywifiextlocal
Published: 2020-07-11 19:28:35

Are you trying to configure your Netgear extender but unable to access setup webpage of mywifiext? Need not to take stress! We are here to help you out! This article will gives you full detail on how to configure your Netgear extender using <a href="https://mywifiexthelp.net/new-extender-setup/">mywifiext setup</a> without any issues. Let’s get the ball rolling.

What Is Mywifiext.Local?

<a href="http://www.mywifiext-local.us/">Mywifiext local</a> is a website of Netgear to setup of your WiFi extender process quite easy for those who needed. With this portal, you can easily setup your Netgear extender with any device whose contain wifi in it.
there are more settings available to change the basic and advance settings of your extender.

Why am I Seeing Error Messages?
Sometimes, when customers try to using mywifiext.local, they see error messages depending on the web browser they use. Google Chrome shows this error “The site can’t be reached” and Safari shows “server not found” error.
So, you need a cable internet connection for using the website.
Netgear Extender Setup Steps using Mywifiext.local
In order to set up your Netgear wireless range with any device whose contain wifi in it. follow all the instructions given below:
	First of all check all wires connected to it and plug the power source using a power adapter.
	On your Mac or iOS device, load up any internet browser.
	Type In the URL bar on the top-right side, mywifiext.local and click on google search.
	The Netgear extender login page will appear.
	In the first colum, enter your username and password in the next field.
	Once all done, now click on Log In button.
	After logging in, There is Netgear extender setup on that page.
	Simply follow them and do it carefully.
Now, you can setup your Netgear Range Extender with any device whose contain wifi in it.

Bonus Tip: If you need quick assistance for setup Netgear extender with Windows or Android devices, Click here www.mywifiext.net and fill contact form they will reach you.

Unable to Access Mywifiext Local Setup Page?
Worry not! You only have to do these given below troubleshooting steps and fix mywifiext local issues.
	Firstly, ensure that your Netgear extender’s wall plug is not damaged.
	Examine the cable connections. There should not be any loose connection.
	Remember to using the updated web browser version for accessing the extender’s default web address.
	The extender’s power LED must be solid green.
	Remove history of that web browser and there is also temporary junk files delete it also.
	If its not working on that browser, change the browser and try it for mywifiext local login.
	Make sure your Netgear extender is neat and clean 
	If you still facing problem you need to contact the Netgear Extender on their site www.mywifiext.net