teleren/devto huggingface dataset:
Flutter set up for android on mac
Tags: flutter, mac, installation, android
Published: 2020-08-06 03:43:54


 
__Make sure you have installed `JDK` and `android-studio`.__

First We have to download flutter Manually unzipping the folder on `desktop`.Then place the `flutter` file inside  `/home` creating a new directory `/developer` and inside the folder, we have to place the `flutter` file. you should do manually opening finder.
 
 

#Second thing You should do#
then after placing flutter file inside the `/User/developer` you have to configure your flutter so you need to 
edit bash_profile so you need to add the command changes the flutter file location then change it to what is necessary to make.

 open up The terminal then place the command and place `cd ~/` it will take you to the `home` directory.
 
then `vi ~/.bash_profile` it will open up the text editor you just enter `e` to edit the file

Press 'i' to insert the file then add a line inside `bash_profile`
```
 #export
 export PATH="$PATH:/Users/thedkn/Developer/flutter/bin"
```
 
After configuring the path variable you enter `ESC` key then
Press `Shift-z-z` to save and exit.


#Flutter Set up on the visual studio code#
you should have to download the flutter plugin 1st one is the flutter  then install it then after it will ask you for 
 install some Extention
  1. Flutter  
  2. Awesome Flutter Snippets

after the installation completed open up terminal go to `cd Desktop` then a project by `flutter create project_name` the `project_name` is according to your project make sure project name is always in `small latter`. 

#Run Project#
 To Run, the project we have to check the flutter is successfully installed or not we have to check in the terminal by command `flutter doctor`. 

opening our project on vs code simply go to  `Run & Debug` then select an emulator installed and it automatically runs your project on Emulator


#Fix the common problems arise in Development#

A most common problem arises due to the app is compiled wrongly so before you Run delete the `build` folder which is inside the root of your project.

__hope you find it valuable. thank you!__
An ELI5 version of REGEX and NFA
Tags: regex, eli5, nfa
Published: 2020-08-06 03:20:15

You have 🤖 a robot (our automaton) that will “walk” through the REGEX dungeon, room by room 🏚 (character by character). Now imagine **each room is locked**, and in order **to access the next one it needs to collect from the string the key (or keys) character** that unlocks the next REGEX door.

If the robot reaches the end of the REGEX, it’s free and it's a match!, if it gets stuck with a character that doesn’t open the next door it gets kicked to the start of the REGEX and needs to try again from the next string character. So if it has the string: `"budega"`, and it fails at "b", it will try to open the REGEX again using `"udega"` (no matter how much progress it made on the previous dungeon).

If a robot is trying to match the dungeon `/there/`, it will need a set of keys that are able to unlock each of its 5 doors (`t`, `h`, `e`, `r`, `e`) in perfect succession:

- If I give it `”there”`. It will ofc use all the keys and successfully reach the end.
- If I give it `”here”` it never even starts, since it would never be able to unlock the first door. It would try `"here"`, then `"ere"`, then `"re"`, then `"e"` and leave the dungeon feeling sad 🙁.
- If I give it `”then go over there”` the robot would probably feel very confident going over the initial `“the”` only to get stuck with an `“n”` that can’t unlock the next door `r` and get kicked to try all over again with `"hen go over there”`. It would then successively fail in the first character until it got to try with `"there”`, and finally be happy again. 🎉

Some doors can be opened with a varying number of characters (quantifiers) or different ones (ranges).

A robot in the `/[hm]el+ow?/` dungeon has 5 doors (characters) to cross: `[hm]`, `e`, `l+`, `o` and `w?`.

- `“hello”` would be a match since the first door can be opened with either an `"h"` or an `"m"`. And the `l+` door would use both ls, leaving the robot with an `“o”` to use in the next door `o`. The last door `w?` can be opened with 0 or 1 valid keys. It has 0, so it gets through it.
- `“mellow”` also works for the same reasons above. At the last door `w?` it uses its 1 `“w”` and goes through it. Yay!

Anyway. I think I had way too much fun painting it in more vivid colors. I hope it helped.
How the delete operator can be your super saver
Tags: javascript
Published: 2020-08-06 03:11:57

# How the delete operator can be your super saver

In this article lets discuss how the delete operator in javascript can be your rescuer. I'm jotting down my learning and working experience, so that others may found useful.

Recently I came up with a scenario where there is an array of objects with the different fields of value, and I want to remove the unwanted fields in the object and return it as an object. 
  
  Example: Array of objects with different fields. 
  ```
      rewards = [
        {
            _id: "5d6fcdf63eb318a9d6981f35",
            type: "welcome_offer",
            discount: 15,
            status: true, 
            validity: "05-09-2020"
        },
        {
           _id:"5d779b833eb318a9d6f60528",
           type: "extend_subscription",
           duration: 3,
           status: true,
           validity: "05-09-2020"
        },
        {
            _id: "5d7b700b3eb318a9d6227637",
            type: "unlock_course",
            eligiblePlans: [ "js-combo", "react-combo"],
            status: true,
            validity: "05-09-2020"
        }
    ]
  ```
  
 How the actual outcome should be? 

```
    rewards: {
        "WELCOME_OFFER": {
            discount: 15,
            validity: "05-09-2020"
        },
        "EXTEND_SUBSCRIPTION": {
            duration: 3,
            validity: "05-09-2020"
        },
        "UNLOCK_COURSE": {
            eligiblePlans: [ "js-combo", "react-combo"],
            validity: "05-09-2020"
        }
    }
```
So how can bring the above array to this format?  

1. Need to convert the array to object. So we can use the reduce function in javascript to convert to a single object. Okay!
2. To capitalise the type, we can just use toUpperCase() function. Okay, that also fine. 

How can we remove the unwanted fields in the object? 🤔
There comes the [delete operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete) to rescue me. 
    
    The JavaScript delete operator removes a property from an object; if no more references to the same property are held, it is eventually released automatically.

#### Syntax
    delete object.property
    delete object['property'] 

Okay, its time to put all the knowledge into coding. 

```
    const eligible_rewards = rewards.reduce( ( acc, val) => {
             const type    = val.type.toUpperCase();
            const details  = {
                        [type]: {
                        ...val
                }
            }
            delete details[type].type;
            delete details[type].status;
            delete details[type]._id;
            return {...acc, ...details}
        },{})
```

Checkout this snippet in [JSfiddle](https://jsfiddle.net/rams_codes/h1yL7to9/1/)

I'm sure there are other ways to solve the problem. Share your solution in the comment section below. I hope you find this useful. If you find useful keep supporting me. For doubts, suggestions and feedback kindly contact me at [@code_rams](https://twitter.com/code_rams)
Microsoft Azure Pricing Calculator
Published: 2020-08-03 11:35:29

## Introduction

Cost is one of the most important aspects of the cloud and can have a massive impact on your business. Azure has several tools available to help you get a better understanding of cloud spend and some best practices that you can leverage to help you save money.

## Azure pricing calculator

To make estimates easy for customers to create, Microsoft developed the Azure pricing calculator. The Azure pricing calculator is a free web-based tool that allows you to input Azure services and modify properties and options of the services. It outputs the costs per service and total cost for the full estimate.

On the pricing calculator page, you'll see several tabs:

* Products. This tab is where you'll do most of your activity. This tab has all the Azure services listed and is where you'll add or remove services to put together your estimate.
* Example Scenarios This tab has several examples of infrastructure involved in common cloud-based solutions. You can add all the components of the entire scenario to estimate the cost.
* Saved Estimates. This tab has all of your previously saved estimates. We'll go through this process in a moment.
* FAQ. Just as it says, this tab has answers to some frequently asked questions.


# Tried out example scenarios on Azure pricing calculator

I've tried out example Scenarios of CI/CD for Azure Web Apps
Which uses following Azure Products:
* Azure DevOps
* App Service
* Azure Monitor
* Azure Data Lake Storage


### Step 1 — Open Pricing Calculator 

[Azure Pricing Calculator ](https://azure.microsoft.com/en-us/pricing/calculator/)

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

### Step 2 — Click 2nd tab "Example Scenarios" and "CI/CD for Azure Web Apps"

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/50v6d364jvl72pf0koj6.png)

### Step 3 — Check and modify your estimate.

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

## ☁️ Finally you can export, save and share this estimate with your boss! 

Also you can directly purchase the estimated cost.

## Results

We have arrived at a cost estimate for a set of Azure services without spending any money. We didn't create anything, and we have a fully sharable estimate that we can do further analysis or modifications on in the future

>Next! - Azure Advisor!

Thank you for Reading 😊
Quebra de linha em texto longo no Flutter
Tags: dart
Published: 2020-08-06 03:05:55

Aprenda como fazer quebra de linha em texto longo no Flutter.
```dart
final String someText = 
"stuff for the 1st paragraph\n\n"
"stuff for the 2nd paragraph\n\n"
"stuff for the 3rd paragraph\n\n";
```
ou então você pode simplesmente renderizá-lo dentro de um Textwidget como normalmente faria.

Fonte: [stackoverflow](https://stackoverflow.com/questions/51733023/line-breaks-in-long-text-flutter)
Como tratar textos sublinhados no Flutter
Published: 2020-08-06 02:39:37

Aprenda como tratar textos sublinhados no Flutter. Ao sublinhar tudo, você pode definir um TextStyle no widget Text.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rdjy5pmvw6ms5fmhe5ur.png)
```dart
Text(
  'Hello world',
  style: TextStyle(
    decoration: TextDecoration.underline,
  ),
)
```
Se você quiser apenas sublinhar parte do texto, precisará usar Text.rich()(ou um widget RichText) e dividir a cadeia em TextSpans para os quais você pode adicionar um estilo.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ei2ydyahdqcavmtbx7z8.png)
```dart
Text.rich(
  TextSpan(
    text: 'Hello ',
    style: TextStyle(fontSize: 50),
    children: <TextSpan>[
      TextSpan(
          text: 'world',
          style: TextStyle(
            decoration: TextDecoration.underline,
          )),
      // can add more TextSpans here...
    ],
  ),
)
```
TextSpan é um pouco estranho. O text parâmetro é o estilo padrão, mas a children lista contém o texto estilizado (e possivelmente não estilizado) que o segue. Você pode usar uma string vazia textse quiser começar com um texto estilizado.

Você também pode adicionar um TextDecorationStyle para alterar a aparência da decoração. Aqui está tracejado:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/37ave889j90byy5jachw.png)
```dart
Text(
  'Hello world',
  style: TextStyle(
    decoration: TextDecoration.underline,
    decorationStyle: TextDecorationStyle.dashed,
  ),
)
```
e TextDecorationStyle.dotted:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xhy3f0xucdz9r6qutl0k.png)
e TextDecorationStyle.double:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kw2b9v1m0b65yk5egrm4.png)
e TextDecorationStyle.wavy:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cno140wzi0wz2xocg0xs.png)

Fonte: [https://stackoverflow.com](https://stackoverflow.com/questions/50614661/how-to-underline-text-in-flutter)
Flutter ‘keytool’ não é reconhecido como um comando interno ou externo, um programa
Tags: dart
Published: 2020-08-06 02:33:26

Solução para ‘keytool’ não é reconhecido como um comando interno ou externo, um programa… No momento de obter a SHA1 pode ser que você receba o seguinte erro:
```
'keytool' não é reconhecido como um comando internoou externo, um programa operável ou um arquivo em lotes.
```
Isso acontece quando você tenta executar o comando fora da pasta bin do jre.

Para acessar esta pasta, digite o seguinte comando no terminal (substituindo para o seu caminho):
```
cd C:\Program Files\Android\Android Studio\jre\bin
```
Logo após, digite o comando para obter a SHA1:
```
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
```
Sua chave SHA1 aparecerá na tela.

Fonte: https://www.udemy.com/curso-completo-flutter-app-android-ios
Uber clone com Flutter
Published: 2020-08-06 02:30:25

Encontrei essa playlist no YouTube e resolvi postar aqui, é bastante interessante. O conteúdo esta em inglês, porém nada que impeça você de seguir os passos.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n2dxvtgjswfh1jtr3ja9.png)
Link da playlist: https://www.youtube.com/playlist?list=PLmnT6naTGy2TNKTW2W-twfG_gFuCtnFQF
Flutter shared_preferences
Published: 2020-08-06 02:27:39

Envolve NSUserDefaults (no iOS) e SharedPreferences (no Android), fornecendo um armazenamento persistente para dados simples. Os dados são mantidos no disco de forma assíncrona. Nenhuma plataforma pode garantir que as gravações serão mantidas no disco após o retorno e esse plug-in não deve ser usado para armazenar dados críticos

### Uso
Para usar esse plug-in, adicione shared_preferencescomo uma dependência no seu arquivo pubspec.yaml .

### 1. Instalação
Adicione isso ao arquivo pubspec.yaml do seu pacote:
```
dependencies:
  shared_preferences: ^0.5.3+4
```
### 2. Instale. 
Você pode instalar pacotes a partir da linha de comando:
```
$ flutter pub get
```
Como alternativa, seu editor pode suportar flutter pub get. Verifique os documentos do seu editor para saber mais.
### 3. Importe
Agora, no seu código Dart, você pode usar:
```
import 'package:shared_preferences/shared_preferences.dart';
```

## Exemplo
```
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Center(
      child: RaisedButton(
        onPressed: _incrementCounter,
        child: Text('Increment Counter'),
        ),
      ),
    ),
  ));
}

_incrementCounter() async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  int counter = (prefs.getInt('counter') ?? 0) + 1;
  print('Pressed $counter times.');
  await prefs.setInt('counter', counter);
}
```
## Teste
Você pode preencher SharedPreferencescom valores iniciais em seus testes executando este código:
```
const MethodChannel('plugins.flutter.io/shared_preferences')
  .setMockMethodCallHandler((MethodCall methodCall) async {
    if (methodCall.method == 'getAll') {
      return <String, dynamic>{}; // set initial values here if desired
    }
    return null;
  });
```
Fonte: https://pub.dev/packages/shared_preferences
The Saddest Thing I Faced In Coding
Tags: discuss
Published: 2020-08-06 02:23:04

No matter how long time I learned,
No matter how hard I learned,
No matter what I had learned.

I feel like not moving forward~
Like I'm stuck in beginner level for a long time~
I still don't know how to code well.

- I code slow,
- Research takes me at least half-day or a few days,
- Don't know how to write the code without referencing the doc,
- Some bugs like forever don't know how to settle, end up delete the entire project and start over again,
- Not sure my code is right or not, it's seen working but the UI seen like something went wrong,

Are you facing the same situation?
What obstacle are you facing?

"Btw, I'm still proud of myself for starting my journey as a self-taught developer."
Scalable python SaaS backend?
Tags: question, python, saas, backend
Published: 2020-08-06 02:15:48

---
title: Scalable python SaaS backend?
published: true
description: 
tags: question, python, saas, backend
//cover_image: https://direct_url_to_image.jpg
---

I have seen several of these boilerplate SaaS apps for Nodejs and php that provide a ready made framework with auth, payments, user management, etc... but I don’t know any for python. Is that something python devs or makers working with python devs would find useful and pay for?
Something that lets you skip the basics of app dev, let’s you get right to writing your app’s unique code, complete with user/payments/subscription management, auth, security, and docs on deploying and scaling on AWS or GCP using docker to scale automatically as needed.
I’m a software architect and have built several products that scaled to millions of requests per day, so I’ve done that part several times. Just trying to gauge interest/usefulness.
too many things to learn
Published: 2020-08-06 02:04:00

---
title: too many things to learn
published: true
description: too many things to learn
tags: 
//cover_image: https://direct_url_to_image.jpg
---

Recently while struggling and failing to get Ansible to bend to my will. I thought to myself. There are too many things to learn.

I know how to admin a server. I know how to do each thing I was trying to get Ansible to do... but yet I could not get it to do what I wanted.

I finally gave up. The abstraction was too much. I wanted to get finished. So I did some of it by hand and some with fabric (which is a lot easier than Ansible).

No real lesson here. I have programmed for many years. I have worked in tech for many years. And sometimes even I run into things that I cannot figure out. Our business is mentally draining sometimes.
Linux retira termos racistas do seu sistema
Tags: linux, programacao, webdev
Published: 2020-08-06 01:38:58

Linus, o engenheiro responsável pelo kernel Linux, aprovou na sexta passada a adoção de uma nova terminologia para o sistema operacional e sua documentação. A proposta é impedir termos que podem ter ou têm conotações racistas como, por exemplo, 'blacklist' e 'slave'. Os novos termos foram escolhidos de acordo com o que o time de desenvolvedores achavam apropriado.

Na tecnologia, diversas empresas estão fazendo esse movimento, trazendo termos neutros para seus ambientes com o objetivo de tornar o desenvolvimento mais acolhedor e inclusivo. Em 2014, Drupal e Django foram pioneiros nesse quesito, em seguida o Python, no ano de 2018.

Após a morte de George Floyd, mais empresas estão mudando. Recentemente o GitHub anunciou medidas, logo em seguida Microsoft, Twitter, LinkedIn, MySQL e outros. Esses são passos extremamente importantes para a não normalização de termos carregados de conotações raciais. Espero que inspire cada vez mais empresas.

Veja mais: [Artigo na The Next Web](https://thenextweb.com/dd/2020/07/13/linux-kernel-will-no-longer-use-terms-blacklist-and-slave/)
Make a Secure Browser?
Tags: webdev, security, react, help
Published: 2020-08-06 01:28:45

Ok, so I’ve been working on a learning platform for making teacher created playlist of content. One of the next steps is to create some type of quiz situation. 

As a teacher, I’ve used “locked browsers” before, where once a student begins a quiz their browser locks and they cannot navigate away or open new tabs until they either finish the quiz or exit/end it. 

My question is...is there any way to do this from a web dev perspective, or are people just straight up making their own browsers? I can’t seem to find any way to do this from my searching online.
How I succeed to renew SSL with certbot in AMI Linux
Tags: tutorials, amazon, certbot, linux
Published: 2021-02-01 11:09:25

---
title: How I succeed to renew SSL with certbot in AMI Linux
published: true
date: 2020-08-06 01:09:00 UTC
tags: Tutorials,Amazon,certbot,Linux
canonical_url: https://boobo94.xyz/tutorials/renew-ssl-with-certbot-in-ami-linux/
---

Hello fellas. Last week I had some major issues with our SSL which wasn’t renewed. At first look, all was in place. I use Let’s encrypt certificate and Certbot tool. As the title mention, it’s all happening on Amazon AMI Linux.

The problem was that the cronjob was not executed. I configured the script initially using `sudo`:

```
$ sudo crontab -e
```

In order to fix the problem, I had to use crontab -e and run the script as root, as you can see below:

Run

```
$ crontab -e
```

And at the end of file add the following:

```

0 0 * * * sudo -u root /usr/bin/certbot renew --quiet
```

I hope this article was helpful. If you consider that please give it a share and take a look at my other articles.

The post [How I succeed to renew SSL with certbot in AMI Linux](https://boobo94.xyz/tutorials/renew-ssl-with-certbot-in-ami-linux/) appeared first on [boobo94](https://boobo94.xyz).
Join the #100daysofcode challenge now.
Tags: 100daysofcode, javascript, html, codenewbie
Published: 2020-08-06 00:41:33

I will code for at least an hour every day for the next 100 days.

I’ve decided to make this a public commitment.

And you should join me.

Like many other people to track your progress, fork this repo: https://github.com/Kallaway/100-days-of-code
---or---
You can create a code log website like me,
https://zhoha28.github.io/code-log/

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


NOTE: For the most updated information on the challenge visit:
The 100DaysOfCode Official Website

The reasons why I have started this challenge are :
1. I am just starting out and it scares me that there are so many things and languages that I don't know and have to learn, I
really want to become a better developer. But I find that after work, I always find other things to do rather than code.

2. This will help me focus at least an hour of my time coding new projects and learning new stuff.

3. It will also help me build my portfolio.

That’s why I want to make sure that I commit to a challenge that will keep me accountable to anyone who follows me or sees my updates.
Making a public commitment has proven to improve people’s ability to stick to changes and new habits. So let’s do this together!

It’s easy to kick back and start watching a show, but difficult to stop. Especially during times like now, it is almost impossible to get the courage to work on something due to the lockdown, our boredom and laziness has gone to the roof.
With things that are worthwhile like learning something new or getting better at coding or a language, I find that it’s hard to start, but very easy to continue. 
So with this challenge, I will make sure that I start (sit down to code) every day no matter what.



I hope you got some things out of this article, it’s my first one as I just started to get into writing so I’m sorry about any typos whatsoever.
I just really wanted to put out something and tell my story.
Bem-vind@ ao Rapadura Dev
Tags: brasil, brazil, kotlin, android
Published: 2020-08-06 00:36:35

Gostaria de compartilhar com vocês um projeto que comecei recentemente, se trata de um canal no YouTube onde vou postar vídeos todo domingo sobre tecnologias que estão em alta no mercado.
O primeiro curso é sobre a linguagem de programação Kotlin

Vou ficar muito feliz em ouvir seu feedback 🤗️

[Rapadura Dev - YouTube](youtube.com/rapaduradev)
[Rapadura Dev - Instagram](www.instagram.com/rapadura.dev/)