teleren/devto huggingface dataset:
Builds desde Unity en la nube(sin salir de GitHub) ☁️🔧 [2/3]
Tags: gamedev, github, unity3d
Published: 2022-05-02 16:47:18

## Introducción 

En el [post anterior de esta serie](https://dev.to/kawzar/builds-desde-unity-en-la-nubesin-salir-de-github-13-10hc), vimos una introduccion a las GitHub Actions y tambien maquetamos lo que sera nuestro workflow para esta serie de posts. 

Asi habia quedado:

{% gist https://gist.github.com/kawzar/f37df771bc2a1f18a7e81622d277abd0 %}


## Modelo mental

- Agregaremos dos nuevos jobs a nuestro workflow. Estos se ejecutaran luego del build.
- El primero de esos jobs, copia la build que expusimos como artifact en el paso anterior a un servidor FTP.
- El segundo job, manda un mensaje a Discord una vez que la copia al FTP se realizo correctamente. 

## Manos a la obra

Como ya nos familiarizamos con el pipeline de las GitHub Actions en el post anterior, voy a dejar mas abajo el esqueleto del workflow terminado exceptuando el detalle del codigo para el job de build. 

{% gist https://gist.github.com/kawzar/fda438e45c7e18d900e185ae1bfd1799 %}

### Copiar al FTP

En este caso, usaremos el action [dist-to-ftp](https://github.com/isthatcentered/dist-to-ftp) que se encuentra disponible en el Marketplace de GitHub Actions.

Para guardar de forma segura la URL de nuestro FTP, asi como sus accesos usaremos _secrets_. Los secretos pueden configurarse en GitHub a nivel de repositorio en `Settings -> Secrets -> Actions`. 

![Listado de secrets en un repositorio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8jejo5hpd4termfn6y1z.png)


### Mandar un mensaje a Discord

De nuevo usaremos una accion disponible en el marketplace, esta vez [action-discord](https://github.com/Ilshidur/action-discord). Leyendo su documentacion nos encontramos con que primero debemos configurar un WebHook para un canal en nuestro servidor Discord. Esto puede hacerse [siguiendo los pasos dados en su propia documentacion](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks). 

Una vez que creamos nuestro webhook, guardaremos nuevamente estos valores como _secrets_ a nivel del repositorio.

### Wrap up

Si vamos a la pestaña de `Actions` tal y como en el post anterior, podemos correr nuevamente el workflow y chequear su ejecucion. 
Si todo resulto bien, cuando el build se realice y se copie exitosamente al FTP, recibiremos un mensaje en nuestro canal de discord con un link que apunta a la nueva version. 

---
La imagen de cabecera es de Natasha Remarchuk
[Python] Estrutura de Repetição 'for'
Tags: python, resume, braziliandevs, beginners
Published: 2022-05-02 16:46:09




#O Que são estruturas de repetição? 
_De acordo com meu entendimento._

---

##Resumo da semana:


As `estruturas de repetição` também conhecidas como `laços`, `loops` ou `iterações` são comandos que nos permitem executar um bloco de instruções em uma determinada quantidade de vezes até que uma ação seja concluída. Com essas estruturas podemos repetir um comando sem que haja a necessidade de digitá-las várias vezes, permitindo assim, uma melhor compreensão do código e ocupando menos linhas no nosso terminal.


No caso de `Python` temos duas `estruturas de repetição`, mas essa semana o meu aprendizado está voltado a `estrutura de repetição for(para)` com a `função range(intervalo)`. Essa estrutura cria uma lista de valores que nos permite executar um comando de acordo com os argumentos inseridos dentro da função.


Na função podemos utilizar números inteiros ou `variáveis` nos parâmetros de `star(início - inicio da contagem)`, `stop (fim - fim da contagem)` e `step(passo - incremento ou decremento)`. Caso nenhum valor inicial seja incluso, o programa automaticamente iniciara sua contagem do zero até o valor final, sendo que o `stop` é o único padrão obrigatório para execução do comando.


Por padrão o programa acrescenta 1 a cada repetição e não considera o último número, então se quisermos a repetição de um comando no intervalo de 1 a 10 podemos adicionar mais um número no parâmetro stop ou diminuímos um número no início.


Já para percorrermos um valor de forma regressiva é necessário inverter a posição do `start` e `stop` e colocar um `decremento`, assim o programa será executado de acordo com o que precisamos, caso contrário o sistema finalizaria o programa sem retornar o valor esperado.


##Sintaxe de uma estrutura de repetição for:

```python
for variável in range(start, stop, step): 
	Ações que necessitam de repetição 

```

##Minhas maiores dificuldades:

- Clareza na identificação dos blocos de comando e consequentemente na aplicação de uma `indentação` adequada.
Is there any way to Hide element for online website from screensharing ( Mikogo , Screenleap , JoinMe)
Tags: javascript, programming, webdev, css
Published: 2022-05-02 16:36:21

i have been looking for way to hide one element in a website during the share screen running ( mikogo , screenleap , joinMe or the other screensharing programs ) but i need to this element appears to me only not to the viewers in my screen sharing .

i googled for long time but i didn't find what i am looking for it , is there possible way to do that or not .

is there any code i write to hide this element from screensharing .

Best Regards .
Day-78 Training At Ryaz
Tags: javascript, webdev, beginners, programming
Published: 2022-05-02 16:19:24

- Date:2/05/2022
- Day:Monday

Today, I started at about 10:50 am as I was in progress to complete the java script course and today I stared with the left course firstly I started with promise and fetch api as the Fetch API provides a JavaScript interface for accessing and manipulating parts of the HTTP pipeline, such as requests and responses. It also provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network and The Promise object represents the eventual completion or failure of an asynchronous operation and its resulting value.after this I started with consuming promises We consume a promise by calling then() and catch() methods on the promise. For example, requesting data from an API using fetch which returns a promise. The successCallback is called when a promise is resolved. and after this as my project was not initiated with the basics i.e the bidding project build in node.js so, in rest half of day I started with it as it was not able to build it and run on the server so, I made the necessary changes and now it is working and being run on local host and now problem with it is left that the categories it have i.e the list of items did not get display otherwise it is registering the user and login and logout is working perfectly fine so, this way my day ended up and I get to learn many new things.
Programming Tip #4: Domain Modeling using And and Or types
Tags: fsharp, programmingtips
Published: 2022-05-02 16:02:38

---
title: Programming Tip #4: Domain Modeling using And and Or types
published: true
description: To start in Domain Driven Design, start by using And and Or types to model your domain, the business problem you're solving, using real world language your users use _in_ the code. Do it in small steps, using your compiler to iterate. If you don't have Sum types, Enums can work.
tags: fsharp,programmingtips
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ltpry998b6vwubvg1a7.png
---

Programming Tip #4: Domain Modeling using And and Or types. To learn Domain Driven Design, start by using And and Or types to model your domain, the business problem you're solving, using real world language your users use _in_ the code. Do it in small steps, using your compiler to iterate. If you don't have Sum types, Enums can work.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ltpry998b6vwubvg1a7.png)

Learn More:

{% youtube 2JB1_e5wZmU %}
Set up a wired serial communication between Arduino boards
Tags: iot, cpp, arduino, serialport
Published: 2022-05-02 16:00:26



## This blog explains how to set up wired serial communication between two Arduino boards.

> _This tutorial is meant for those with some knowledge of Arduino and IoT._
> The purpose of building this blog is to write down the detailed operation history and my memo for learning the Arduino.
> If you are also interested and want to get hands dirty, just follow these steps below and have fun!~

### Tools will be used:
- Two Arduino boards (e.g., mines are yún and 101)
- Jump wires (Two are enough)

### Prerequisites
- Boards are firmly connected via USB to computers
- Boards drivers are properly installed
- Ports are identified by the computers
- Jump wires connect one's TX with another's RX, and one's RX with another's TX

## Getting Started
#### Code for the master board (Arduino 101):
> Send integer data to slave board
```cpp
void setup() {
  // Begin the Serial at 9600 Baud
  Serial.begin(9600);
  Serial1.begin(9600);
}

int thisByte = 33;

void loop() {
  Serial1.write(thisByte); //Write the serial data
  if (thisByte == 126) {    // you could also use if (thisByte == '~') {
     //This loop loops forever and does nothing
     // holds
    while (true) {
      continue;
    }
    //thisByte = 32;
  }
  // go on to the next character
  thisByte ++;
  //delay(1000);
}
```

#### Code for slave board (Arduino yún)
> Receive data from the master board, and print the data to console
```cpp
int incomingByte = 0;  

void setup() {
  // Begin the Serial at 9600 Baud
  Serial1.begin(9600);
  Serial.begin(9600);
}
void loop() {
  // send data only when you receive data:
  if (Serial1.available() > 0) {
  // read the incoming byte:
     incomingByte = Serial1.read();
     // say what you got:
     Serial.print("Received:  ");
     Serial.write(incomingByte);
     Serial.print("    DEC:  ");
     Serial.print(incomingByte, DEC);
     Serial.print("    HEX:  ");
     Serial.print(incomingByte, HEX);
     Serial.print("    OCT:  ");
     Serial.print(incomingByte, OCT);
     Serial.print("    BIN:  ");
     Serial.print(incomingByte, BIN);
     Serial.println(" ");
   }
}
```

### Part of the Results

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bct9kbh3ojt0vhtmjs0j.png)

### Trouble Shooting
1. [Install Arduino IDE to Linux and enable serial ports](https://docs.arduino.cc/software/ide-v1/tutorials/Linux)
2. [Official docs for serial communication](https://www.arduino.cc/reference/en/language/functions/communication/serial/)

### References
https://docs.arduino.cc/software/ide-v1/tutorials/Linux
https://www.circuitbasics.com/how-to-set-up-uart-communication-for-arduino/
React Tricks Miniseries 4: How to remove element from useState array
Tags: react, javascript, arrays, usestate
Published: 2022-05-02 15:59:11

The useState hook in react works wonders and can be used to manipulate variables of various data types.

However, the trickiest to manipulate is probably array types. Pushing to, removing from and editing an array in javascript is rather simple but with useState it becomes a little complex, especially if you are following react's best practices for state.

Let's see how we can perform these best practices to add, remove and edit an array that is a state.

## Pushing
This one is mostly simple and most developers do it correctly. It is simply a matter of making use of the previous state and adding your element after the previous elements like so:

```javascript
setFruits(prev => [...prev, 'apple'])
```

## Removing
Removing is where it gets complicated. Over the years i have seen many developers use all kinds of non best practices 'hacks' to achieve this. There was even a very popular and accepted answer on Stack Overflow that was also not best practice for useState. It suggested to perform regular javascript array.splice() and then update the state with setState(prev => [...prev]). Not good! 

All these solutions definitely did work, but if you want to follow react's best practice then here is how to do remove from an array:

#Solution
The idea is to never mutate the state in setState in react. So you always need to use the previous value. Thus removing an element from a state array in react should be performed like this:

```javascript
let elementToRemove = 'orange'
setFruits(prev => prev.filter(fruit => fruit !== elementToRemove ))
```

In a single line we can remove the element we wanted, without using javascript methods, or mutating our state.
You can test it out for yourself!

# Conclusion
Removing an element from a state array is simple and done in one line but needs to be carefully performed without mutating the state in order to follow best react practices.
Develop your hardware product following microservices methodologies.
Tags: opensource, microservices, hardware, luos
Published: 2022-05-02 15:48:25

In this video, you will discover the power of Luos and what it is capable of. 

{% embed https://www.youtube.com/embed/KHHB_jfBDEY %}

We will show you through a use case of a connected bike alarm the advantages of using Luos. 

Luos works on bare metal or on RTOS and OS. You can use it with STM32, Arduino, Raspberry Pi, and many other boards.
Creating Own PHP Helpers in a Laravel Project
Tags: laravel, beginners, webdev, tutorial
Published: 2022-05-02 15:39:43

Laravel has variety of global “helper” functions. We are free to use them in our own applications like app_path, ucfirst, auth, env etc. We can also define our own set of helper functions for Laravel applications and PHP packages. And we can use composer to import them. Also we can use them directly without import.

## Creating a Helpers file in a Laravel App
First create a file in **app/Helpers/Helper.php**

## Autoloading Helper File in Laravel
Open **composer.json** file and add file path in **files** key as shown below.

```json
"autoload": {
    "files": [
        "app/Helpers/Helper.php"
    ],
    "classmap": [
        "database/seeds",
        "database/factories"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
```
Once you add a new path to the **files** array, you need to **dump the autoloader**:

```ssh
composer dump-autoload
```

## Defining Helper Functions in Laravel
Now, you can create your own helper functions as shown below.

```php
if (! function_exists('myCustomFunc')) {
    function myCustomFunc($default = null) {
        // ...
    }
}
```

**If you are unable to run composer commands. Then you should try this method.**

Open your helper file **app/Helpers/Helper.php**. **Create a class And create static functions as shown below**.

```php
<?php

namespace App\Helpers;

class Helper
{

	public static function myCustomFunc()
	{

	}

}
```
Now, Creating Own PHP Helpers in a Laravel Project and use functions like this **\App\Helpers\Helper::myCustomFunc()**.

---

Please like share subscribe and give positive feedback to motivate me to write more for you.

For more tutorials [please visit my website](https://www.w3courses.org/tutorials/).

Thanks:)
Happy Coding:)
[Ann] Rivendell updated
Tags: linux, bash
Published: 2022-05-02 15:33:57

## About

[Rivendell](https://github.com/crinklywrappr/rivendell) adds useful functionality to [elvish](https://elv.sh/) to take your shell to the next level!

:rainbow: functional bits: high-level functions which encapsulate common design patterns.
:zzz: lazy iterators: transducer-inspired iterators which allow you to represent infinite sequences.
:chart_with_upwards_trend: visual aids: sparklines & histograms.
:wrench: plus a toolbelt of common utility functions which operate on strings, lists, and maps.


## How to install

It's a 3-step process.

- Add these lines to your `~/.config/elvish/rc.elv`

```elvish
epm:install &silent-if-installed=$true github.com/crinklywrappr/rivendell
epm:upgrade github.com/crinklywrappr/rivendell
```

- Request modules à la carte.

```elvish
use github.com/crinklywrappr/rivendell/test t
use github.com/crinklywrappr/rivendell/base b
use github.com/crinklywrappr/rivendell/fun f
use github.com/crinklywrappr/rivendell/lazy l
use github.com/crinklywrappr/rivendell/rune r
use github.com/crinklywrappr/rivendell/algo a
use github.com/crinklywrappr/rivendell/vis v
```

- Do cool stuff!

```elvish

# lazily graphing population data from the 2021 census

var file = (a:lines NST-EST2021-alldata.csv)

var f = {|line| s:split , $line | f:listify}

var popkeys = ($f (l:first $file))

l:drop 6 $file ^
| l:each (f:comp $f (f:partial $f:zipmap~ $popkeys) (f:juxt (f:k NAME) (f:k POPESTIMATE2021)) $f:listify~) ^
| l:take 20 ^
| l:blast ^
| v:barky &min=0

        Alabama ████████
         Alaska █
        Arizona ███████████
       Arkansas ████
     California ███████████████████████████████████████████████████████████████
       Colorado █████████
    Connecticut █████
       Delaware █
District of Co… █
        Florida ███████████████████████████████████
        Georgia █████████████████
         Hawaii ██
          Idaho ███
       Illinois ████████████████████
        Indiana ███████████
           Iowa █████
         Kansas ████
       Kentucky ███████
      Louisiana ███████
          Maine ██
```


## Documentation in the terminal

Command-line users are recommended to use [glow](https://github.com/charmbracelet/glow).

Run the following command to browse the docs.

```shell
glow ~/.local/share/elvish/lib/github.com/crinklywrappr/rivendell/
```

![Browsing downloaded documentation inside glow](https://user-images.githubusercontent.com/56522/165880434-6fd21c05-56ae-45a0-8813-2d0792f056fb.png)
100 Days of Swift - Day 4
Tags: swift
Published: 2022-04-04 00:09:32

Continuation of [Hacking With Swift](https://www.hackingwithswift.com/) [100 Days of Swift](https://www.hackingwithswift.com/100)

Day 4 - Looooooooops

1. For loops
For loops are done on a python way (maybe swift did it first?) but without the required indentation. So if you want to loop through [1,2,3,4] you'd do:
`
for number in [1,2,3,4] {
 print(number)
}
`

PS: Discard (the underscore _ ) is accepted if you don't want/need the actual variable

2. While loops
Nothing fancy to see here

3. Repeat Loops
Basically do whiles

4. Breaking and skipping in loops
While the keyword `continue` is just your everyday reserved word, breaks are _really_ interesting. 

Swift supports something called "labeled statements". Imagine the following nested loop:

`
for option1 in options {
    for option2 in options {
        // do code here
    }
}
`

Like in other languages, if we use the keyword `break` it will exit the inner loop only, inside a function we could add a return but that's if we are inside a function, so how do we exit the parent? well you give it a label and then you tell swift to `break label_name;` example:

`outerLoop: for option1 in options {
    for option2 in options {
        break outerLoop;
    }
}`

Pretty neat in my opinion.
Consuming REST API in GO
Tags: go, rest, api
Published: 2022-05-02 15:17:35


![Consuming REST API GO](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdaab3fglbywbmzlhlqc.png)

Consuming REST API is really simple in GO. The _net/http_ comes with GO standard modules, which we are going to use in this article.

```go
package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

func getMovieDetails(movieName string) map[string]interface{} {

	// response is going to be stored in this variable
	var movieDetailResponse map[string]interface{}

	// url to be fetched, replace the apiikey with your own
	url := "http://www.omdbapi.com/?t=" + movieName + "&apikey=your_key"

	// create a new http request
	res, err := http.Get(url)

	// check for errors
	if err != nil {
		log.Fatal(err)
	}

	// close the response body when function returns
	defer res.Body.Close()

	// read the response body
	body, err := ioutil.ReadAll(res.Body)

	if err != nil {
		log.Fatal(err)
	}

	// unmarshal the json response
	// the body is in []byte format, so we need to convert it to json
	// we can use json.Unmarshal(body, &movieDetailResponse) to unmarshal byte array to json
	if err := json.Unmarshal(body, &movieDetailResponse); err != nil {
		log.Fatal(err)
	}

	// return the movie details
	return movieDetailResponse

}

func main() {
	movieName := "k.g.f chapter 2"
	movieDetail := getMovieDetails(movieName)
	// print the movie details
	fmt.Println("Title", movieDetail["Title"])
	fmt.Println("Genre", movieDetail["Genre"])
	fmt.Println("Plot", movieDetail["Plot"])
}

```

Hope this was insightful. 

For more instant updates follow me on [twitter](https://twitter.com/prash2018)
OPORTUNIDADE AEM
Published: 2022-05-02 15:08:44

Gauge é uma oportunidade do Grupo Stefanini e se define de mentes inquietas, que enxergam a oportunidade para transformar o jogo e podem alterar como o grupo pode alterar os problemas, adaptando aos desafios que importam.

😃Atuar em novos projetos e sustentação de sistemas legados;

Atuar na pesquisa e de novas soluções de software;

Atuação na análise, definição e direcionamento para implementação de novos projetos;

Criar e integrar APIs;

Criar e documentar componentes;

Aplicar/utilizar padrões de projetos (design patterns);

Testar e otimizar as aplicações existentes;

Participar de cerimônias em geral, junto com o tempo;

Disposição para aprender novas tecnologias.

😃Experiência prática com o CMS Adobe Experience Manager (AEM)
Experiência prática em linguagens de programação Experiência nos frameworks OSGI e Sling HTML CSS Java Script Git Maven Figma

🤑6 a 8k CLT + Beneficios
[DASHBOARD] GRIDSTACK + WEBDATAROCKS + FUSIONCHARTS
Tags: codepen, fusioncharts, gridstack, webdatarocks
Published: 2022-05-02 14:50:05

{% codepen https://codepen.io/adrianowy/pen/YzyxKER %}

https://twitter.com/WebDataRocks/status/1304109218048466945?cxt=HHwWgoC7oZSbkJkkAAAA
typeof and lookup type in typescript
Tags: typescript, types, javascript
Published: 2022-05-02 14:48:42

---
title: typeof and lookup type in typescript
published: true
description: 
tags: typescript,types,javascript
cover_image: https://blog.logrocket.com/wp-content/uploads/2022/02/extending-object-like-types-interfaces-typescript.png
---


- The `typeof` key can be used to extract type from an existing  data 

```js
const user = {
  name: "Rubin",
  age: 15,
  address: "Kathmandu"
}

type UserType = typeof user  //  {name: string,age:number,address: string}
```

- Look up types on the other hand are used to extract a portion from a complex type and create a new type

```js
type requestType = {

  payload: {
    name: string,
    user: number,
    roles: {
      edit: boolean,
      create: boolean,
      read: boolean
    }
  },
   params: {
     id: number,
     type: string
   }
}

// if we want to use type of  params as a type then

type Params = requestType["params"]  //  {id: number,type: string }
type Roles = requestType["payload"]["roles"] //   roles: {edit: boolean,create: boolean,read: boolean}

```