teleren/devto huggingface dataset:
Functional programming in Go (fp-go)
Tags: go, functional, programming, opensource
Published: 2022-04-19 21:37:11

---
title: Functional programming in Go (fp-go)
published: true
description: fp-go a collection of Functional Programming helpers powered by Golang 1.18+ generics
tags: go, functional, programming, opensource
cover_image: https://user-images.githubusercontent.com/9580458/162070974-4367f4b8-bb3d-451c-8114-dd578bad4e46.png
---

From the beginning when golang was released i always faced couple of missing bits:
- **Generics**
- **Functional programming**

Then golang v1.18 came out with [generics](https://tip.golang.org/doc/go1.18).
This suddenly unlocked a lot of new ways of writing code in golang.
In detail now it's possible to easily write generic functions that help you to write code in a more functional way.

For this purpose i started an open source project that aims to fill this remaining gap of the language.

{% github https://github.com/repeale/fp-go %}

The project is already in a good shape that allows you to write good functional code. But it's still under development and i'm looking for help to expand the collection of helpers.

Here you could find the list of [Helpers](https://github.com/repeale/fp-go#helpers) with examples.

Couple of core pillars of the library:
- [Currying](#currying)
- [Variations](#variations)

### Currying
By default, data are always at last. This allow to write upfront reusable code that can run with the actual data only when needed.

```golang
// Example with Map helper

func int64toInt(x int64) string {
    return strconv.FormatInt(x, 10)
}

// ...

data := []int64{1, 2, 3}

fp.Map(int64toInt)(data)

// => []string{"1", "2", "3", "4"}
```

### Variations
Each helper come with variations. This allow you to use the right implementation for your use case without having to deal with unused code. The full doc could be found [here](https://github.com/repeale/fp-go#variations) .

```golang
// Available variations

// Default
fp.Map[int, string](func(x int) { ... })

// *WithIndex
fp.MapWithIndex[int, string](func(x int, i int) { ... })

// *WithSlice
fp.MapWithSlice[int, string](func(x int, i int, xs: []int) { ... })
```

Looking forward for contributors, feedbacks and more new features to come i really hope you will enjoy using this package!
SaaS login trends
Tags: saas, security, authentication, sso
Published: 2022-04-19 21:35:56

More and more SaaS apps are only providing social logins (e.g., Google, Facebook, Github), or SSO logins (e.g., Microsoft, Okta) for their enterprise customers. For both cases, SaaS vendors don't have to manage username/password themselves. It is a big relief for them.
TexCreate v2.2 Released!
Tags: programming, tex, opensource, news
Published: 2022-04-19 21:28:39

After releasing Version 2.1, I wanted to focus some more attention on templates, so you can probably guess what is new with this minor update. 

## Added Custom Template support 
So a big update is custom template, and it's best I explain this first, so people understand how to do it. 

To create a custom template, you will need two files, `main.texcreate` and `structure.texcreate`, without these your build will fail. 

Let's create a template called `Simple_Report`, here's the steps: 
### Step 0 - Make sure to have TexCreate v2.2.1 
```
# if you don't have it installed already 
$ cargo install texcreate
# if you have it installed 
$ texcreate update
```

### Step 1 - Create the Directory 
```
# Create the directory and necessary files 
$ mkdir Simple_Report 
$ cd Simple_Report 
$ touch main.texcreate && touch structure.texcreate 
```

### Step 2 - Add the content into your templates 

- `main.texcreate`: 
   - Contains all necessary code for the body 

- `structure.texcreate`:
   - Contains all packages, and extra meta information

### Step 3 - Define the custom template inside `config.toml`
Remove the `template` field and instead replace it with a `custom_template` field, and add the path to `Simple_Report`. With this set, you can now use your very own custom template. 

## Added Templates 
With custom templates available, I also added 2 new prebuilt templates, Dictionary and News. These new templates allow users to create their own dictionary and newspapers, with that said, I also added a new function `no_maketitle()` to `tex_rs::Latex` which will disable `\maketitle` being written to the body of the document (Used in Dictionary and News Templates). 

With that said we now have 11 Templates available, all being available on `texcreate --list` or as shown below: 

```
=======================
  Available Templates
=======================
==> Basic: Designed for simple documents
==> Math: Designed for math focused documents
==> Theatre: Designed to write plays/shows
==> Code: Designed to write code using listings
==> Novel: Designed to write well...novels
==> Beamer: Designed to create presentations
==> Lachaise: Designed for school assignments and academic papers
==> Lachaise-Mod: Modified version of Lachaise Template, changes in colours/design
==> Dictionary: Designed to write your own dictionary
==> News: Designed to write columned newspapers
=======================
```
HOW TO CREATE A JAR FILE ON A SPRING/MAVEN PROJECT
Tags: spring, java, maven
Published: 2022-04-19 21:25:59

A jar file is in fact a server-runnable code.
On terminal execute this command:
`mvn package`
This command will build the project, run the tests and create a jar file. So be sure that all tests are passing.

After that, check the target folder, jar file will be there.

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

Now it is time to run this jar file. Command:
`java -jar <name>.jar`
With this command, the application will be running on the specified localhost port (default 8080). You can test it.

Happy coding with no errors!
Dragon Mania Legends Mod Apk
Published: 2022-04-19 21:03:33

In movies, we have all seen dragons living in the jungles, and in real life, everyone dreams of seeing the world of dragons. A hunter raises a dragon, nurtures it, and trains it as we saw in the dragon movies. Therefore, all we're doing is creating a game with the player owning the dragons here & mixing specific things within the game to form their robust dragon.

![Discover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86eboo3s1e0b5ptfx99z.jpg)
[Dragon Mania Legends](https://apksight.com/dragon-mania-legends-mod-apk/) can be an exciting game that allows you to enjoy a virtual world filled with adorable dragons and epic battles. The dragons can be trained to do battle, complete quests, and even sing to raise their power, which is the game's currency. To reclaim the homeland, you will need to participate in epic battles. The magical land of Dragolandia can be recycled and expanded when players arrive in Dragon Mania Legends.
For legends to be fought, you need to train your dragons properly. Raising cute little dragons will help you teach them to grow into powerful combatants. After that, you can take them to battle against the evil Vikings and save your hometown. In this simulation game, a player controls an entire land as the Dragon Lord.
 

## Gameplay
:
As a player, you can train your dragons and play with them in dragon mania legend. “Dragon Vs. Dragon” battles are pretty standard among dragons. There is no need for hard work to play this game. 

We get the one-time furry from an online store. Furry is based on the team. When furry is damaged, our team is also damaged. You get the food after competing for the dragon. All the food goes to your primary dragon. You just need to get power to make your game time more colorful by fighting with the dragons. Download the mode of this game, and you will go to the next level to challenge the enemy and get a lot of rewards. This is a game that gives you the experience of actual war. You will be in the heroes' outstanding adventure, and you will be the dragon slayer whose mission is to protect your country.
 

## Features
:
**Train your dragon:**
If you want to win all the levels in dragon mania you need to train your dragon. You must teach them master warrior attack. Admit to school and teach new skills. When you teach your dragon then raise them. 
 
**Complete Levels and Increase your collection:**
We know that every gamer needs more collections of characters. After raising your dragon, complete the levels of dragon mania and collect more collections of dragons. You can get more monsters by visiting the magic portals.
 
**Make friends and exchange gifts:**
You can play with friends easily and visit the different worlds. You and your friends exchange your monsters, and dragons with each other. Do clan chat with friends and make the best strategy for the next level of battels.

you can also visit apksight.com for more exciting Apk Mods games latest versions
Kenton's Cloud Resume Challenge
Published: 2022-04-19 20:53:51

This is my blog post about the completed Cloud Resume Challenge.

My completed site is http://kmcloud.tech

I decided to take the Azure flavour of this challenge as I had the Azure Administrator certification.

There were a lot of technologies that I was able to work with that sharpened my Azure skills.

## Frontend

For the frontend I was able to implement Azure Storage and Static Web Apps, Azure CDN and Git.

I made some modifications to an existing HTML site along with the accompanying CSS files, I may try to make more adjustments in the future.

One big thing I needed to figure out was how to initiate steps on the web page being loaded.
Javascript was the best option because of the eventlisteners it had and how it could see the ContentLoaded event of the webpage.
From there we could call an app that would host a counter.

## Backend
For the backend I was able to implement CosmosDB, Azure Functions, Azure Storage and Github Actions.

For the backend I created a C# function that connected into CosmosDB and got the current number for visitors and updated it into the same database.

From VSCode I was able to deploy the function to Azure and host it there.
I did all the coding and designing in VS Code which was new for me. I had some trouble getting the function deployed to Azure for a while because the folder I had open in VS Code wasn't the root where the function was. I eventually opened the backend folder and things started to flow. 

## CI/CD and Git
This was probably the part that got me the most excited. I could host something locally and push it to the internet and the repo would make the changes automatically. I used GitHub Actions for this and with a small number of tweaks to Microsoft's template files, things were running moving smoothly.

Being able to make a small change and not have to worry about moving files around or making sure you have the right file in the right place was exciting for me.

## Next Steps
I think the next thing I wanted to implement was a REST api interface, specifically where I can invoke-restmethod in Powershell and get a response.

This isn't a 'next step' at this point but when I started the challenge I also wanted to get the Azure Solutions Architect Expert certification and I completed that on April 5th.

## Thanks
I wanted to give a quick shout out to Forrest Brazeal for writing the Cloud Resume Challenge book. I also wanted to thank [Gwyn Peña-Siguenza](https://www.youtube.com/madebygps) for the guide video related to Azure and the rest of her Cloud/Azure content.
🦾 Show & explain what BOTs do for us 🧑‍🤝‍🧑
Tags: devops, programming, productivity, codenewbie
Published: 2022-04-19 20:49:39

## ❔ Context


Everyday, **BOTs and CI are doing more and more things for us**.

At the office, to

> build a shared an efficient digital culture,

it is important for programmers (DEVs & OPS) to explain to middle and top management how this technology helps to :

- ➿ **Maintain** existing source code
- 🚀 **Release** software, new features,...
- ⤴️ **Loop** between the two previous activities

> Still it remains a bit abstract.

The goal of this short post is to show how, from a source code point of view,

> how BOTs are an extension of the team and can (should ?) be considered as "real" programmers...

that help us in our daily missions... and focus on what really matters :

> Innovate, learn, create new features as fast as possible to the market... so they can be released (and then maintained).

## 🎥 Movie show

Visual management is a powerful tool to help understand and gain attention on abstract concepts.
So, to put in evidence how BOTs participate to the teamwork, I thought **a short movie could do the job**.

👉 This is where [`gource`](https://gource.io/) helps :

{% github acaudwell/Gource %}

## 🍿 Enjoy collaboration replay

Within a very simple command line :

```
gource \
    --key \
    --highlight-users \
    --date-format "%d/%m/%y" \
    --hide mouse,filenames \
    --file-idle-time 0 \
    --max-files 0  \
    --background-colour 000000 \
    --font-size 25 \
    --output-ppm-stream - \
    | ffmpeg -y -r 30 -f image2pipe \
    -vcodec ppm -i - -b 65536K movie.mp4
```

We can see :

- how humans and BOTs collaborate
- on what
- on which pace
- on wich parts of the project
- new programmers arrival

{% youtube jwXX2jFKUv8 %}

👉 Notice that from a code point of view you can't see the difference between BOTs code and human... **except that BOTS often modify the same files, according to a same pattern.**

## 🙏 Acknowledgments

Thanks a lot to the programmers who played the role of actors in the movie, **_by order of appearance_** 😉 :

- 👨 [`@lschaeffer313`](https://github.com/lschaeffer313)
- 🧔‍♂️ [`@Dougniel`](https://github.com/Dougniel)
- 🤖 [`DependaABOT`](https://github.com/dependabot)
- 🦾 [`semantic-release-bot`](https://github.com/semantic-release-bot)
🤨⁉ How do you manage about picture file size in your company?
Tags: discuss, webdev, productivity, performance
Published: 2022-04-19 20:37:04

## 💎 I've engaged in frontend performance task
It was big .svg file (180kb), so I changed it to png file (45kb). Next.js Image component gets it even smaller in app.

and length and height was also unnecessary long(1180px / 550px), so I also changed it smaller

## 💎 But I thought like that
Performance gets better now, but absolutely this problem will repeat in the future because now image files put on server in this way

```
👩‍🎨(designer) I've created new svg file, so nice hehe
👩‍💻(engineer) thanks! put it on server!
```

## ❓ question
How do you manage about image size in your company?

I have three candidates

> 1. educate about file size to designers, and they adjust file size (not to decrease image quality so much)

> 2. engineer optimise file image size manually

> 3. set some system in server to decrease image size automatically

it's better to create some system which image size decrease automatically somewhere, not by human though
Remix SaaS kit Changelog #3 - Custom Pricing Plan builder
Tags: remix, react, saas, release
Published: 2022-04-19 20:35:36

---
title: Remix SaaS kit Changelog #3 - Custom Pricing Plan builder
published: true
description: +1 issue + 1 closed issue: Custom Pricing Plan builder.
tags: remix,react,saas,release
cover_image: https://yahooder.sirv.com/saasfrontends/remix/blog/changelog/2022-04-19.png
---

[Get the SaaS boilerplate with 50% off](https://alexandromg.gumroad.com/l/SaasFrontends-Remix/early-access)

### Closed issues

✅ #40: Create custom pricing plans
![40](https://user-images.githubusercontent.com/8606530/164090549-df28b2a1-2fff-4e83-9f51-e6f0d05fed77.png)

✅ #37: Delete a Tenant as Admin
![37](https://user-images.githubusercontent.com/8606530/164090789-800e1c40-a804-4b07-ab03-24107ace5e0b.png)

### Added issues

- ⌛ #41: Epic Feature: Entity Builder
5 Simple Productivity Tips For Developers
Tags: productivity, programming, motivation, beginners
Published: 2022-04-19 20:29:44

Being as productive as possible is a goal of every developer. Why? Well, the list of benefits is long and includes your own well-being and work satisfaction.  The tips I prepared for you today are well known, but people (myself included) tend to forget or disregard them as "too simple". And that's a mistake because as we all know, simple is often the best! 

***

## Work fewer hours

It may seem illogical, but working fewer hours per week can improve your productivity. Having less time makes you focus on the tasks you have to finish and makes you dedicate your entire attention to those specific tasks instead of wasting time on distractions. This leads us to the second point:

## Minimize distractions

"Getting in the zone" is not easy, but once you do, doesn't it feel great? In order to achieve this state of mind as often as possible, you should try to avoid distractions in your workplace during working hours. Keep your environment clean and silent and the most important one - turn off Facebook and Instagram, they are the worst time eaters!

## Take breaks

Step away from your computer every hour and move your body. 
You don't have to incorporate a full fitness routine into your working day (although that's strongly recommended), even a short walk around the house or a few stretches can make all the difference. Don't forget to reset your mind too - while you're away from the keyboard think about something different than work - your brain will thank you for every break like this!

## Get proper sleep

You should never sacrifice your nighttime rest - it is during the night when your brain and your body get time to regenerate (even if you're a night owl, try to get 7-8 hours of sleep every day). We all hate deadlines, but sometimes it makes much more sense to go to bed and resume work the next day rather than spend over 12 hours in front of the monitor - you rarely get productive doing so and the quality of your work probably won't be the best. 


## Cherish your weekends

Are you guilty of "bringing your work home" or dedicating a couple of hours on a Saturday afternoon "to get things done?" While it may seem like a good temporary solution when you are overwhelmed with work in the long run it may cause a lot of damage. Not allowing yourself time off will sooner or later influence not only your work but other aspects of life as well. Use your weekends to spend time with your friends and family, practice a new hobby, read a book that's been waiting on a shelf forever or go hiking. You will definitely notice that on Monday morning you feel refreshed, full of energy and ready to rock!

***

I hope these 5 simple ways to become more productive will help you put an end to bad practices and remind you that good work work-life balance is a key to being productive and avoiding burnout.
Use browser dev tools with Blazor Hybrid
Tags: blazor, maui, dotnet
Published: 2022-04-19 20:18:03

As the exciting journey begins into creating hybrid mobile apps with MAUI Blazor, we start including our shiny Blazor components into native apps. But how can you use the Browser dev tools?

First, create a new app using the MAUI Blazor App Preview template:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vdqa7dtcs3rnlv4j56xu.png)

Now add these lines in your `MauiProgram.cs`:
```
#if DEBUG
        builder.Services.AddBlazorWebViewDeveloperTools();
#endif
```

Next, launch app in the Android emulator:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iw1yh56v3mr3an6qw5e8.png)
 
OK, now the app is running, now start a Desktop Edge browser and enter `edge://inspect/#devices` as url:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/use0k2p5eus41iodn6kd.png)

After a few seconds a Remove target appears with your app name in it:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1qlcfmxi79eeaqnq7vnc.png)

Finally, click inspect to launch the Dev tools for your instance and now you can use all your existing tools like inspect, layout etc!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k9o69if1ae06cekumbp6.png)
Remove all your local git branches but keep main
Tags: git, github
Published: 2022-04-19 20:16:25

I frequently search for the code to delete all local branches except _master_ so I can copy/paste the result, but I always get the "master" version of this — which doesn't help the copy/paste part of it.

```bash
$ git branch | grep -v "main" | xargs git branch -D 
```

Here's hoping _this_ becomes the top result so I can speed up my process by one second. We all know I'll never _actually remember_ the command.

Happy coding!
Introdução ao Node.js - Parte 1
Tags: beginners, node, braziliandevs
Published: 2022-04-19 20:15:04

## O que é o Node.js ? Uma linguagem?

Os navegadores são um ambiente de execução que aceita html, css e javascript nativamente.

O node.js não é uma linguagem, e sim um ambiente de execução onde você pode utilizar a linguagem javascript fora do navegador(browser).

O ambiente de execução seria o local que inclui tudo que é necessario para rodar codigo javascript nele: v8 engine, modulos do node etc.

## O que NPM?
É o gerenciador de pacotes que vem disponivel com o node.js
Ele serve para ajudar no gerenciamento e configurações de modulos, instalar, atualizar ou remover dependencias.

## O que são Módulos?
São um conjunto de códigos/scripts que são organizados em um ou mais arquivos
Com a vantagem de não poluir o escopo global e de ser reaproveitaveis.

**Existem 3 categorias de módulos**
### Módulos Internos - Módulos que desenvolvemos
```js
const soma = require("./soma.js");
const subtracao = require("./subtracao.js");

console.log(soma(1, 2));
console.log(subtracao(10, 2));
```
Na primeira e segunda linha é chamado um método require que é responsivel por importar módulos passando o caminho(path) onde está o arquivo.
No arquivo soma.js, está assim:
```js
const soma = (a, b) => a + b;
module.exports = soma;
```
module.exports permite que eu deixe a função soma disponivel para outro arquivo.

### Core Modules - Módulos que vem com o node.js
```js
const path = require("path"); // importa o módulo interno path
const extension = path.extname("main.py"); // com o path importado, temos acesso ao metodo extname()
console.log(`Qual a extensão desse arquivo? ${extension}`); // informa qual a extensão do arquivo
```

### Módulos Externos(Third-party Modules) - Módulos que instalamos via npm
Para receber módulos de terceiros no projeto, utliza o comando:
```
npm init
```
Depois desse comando é criado um arquivo chamado package.json, mais ou menos assim:
```js
{
  "name": "testes",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}
```
Podemos instalar um módulo com o comando:
```
npm install <nome do modulo>
```
A partir dai os modulos ficam no diretório node_modules
```
npm install nodemon
```
Exemplo de módulo externo utilizado é o nodemon, que serve para reiniciar o servidor
automaticamente após alterações.

**Em breve vem a parte 2**
Telescope final release 3.0
Published: 2022-04-19 20:11:40

Release 3.0

We will push our final release in a few days, and I would like to talk about it. 

First of all, it was a great semester, and I worked with many different technologies included in Telescope architecture.

Meeting and being Sheriff was my most loved part because it helped me improve my skills. 

Currently, I have one issue left regarding Nginx. I hope to finish by the end of the semester.

I hope that we will successfully launch our 3.0 release and slowly move to the following heights. 
  
Lastly, Thank you to every team member and professor I worked with on OSD and Telescope. 
  

### Conclusion

⚠️ Computer Architecture Blog Post: Link

### Links

🖇 Follow me on [GitHub](https://github.com/aserputov) 

🖇 Follow me on [Twitter](https://twitter.com/aserputov)

_p.s This post was made for Telescope.