teleren/devto huggingface dataset:
Python-dotenv (Keep your secrets safe)
Tags: python, flask, programming, security
Published: 2021-09-05 20:12:48

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

Is the security of your website / app threatened? Do you know how to keep your secrets safe during develepoment and production stage? In this article, i am going to guide you on how to work with SECRETS and KEYS without exposing them to the outside world, and keep them safe during development too! 

**Python-dotenv** is a Python module that allows you to specify environment variables in traditional UNIX-like “.env” (dot-env) file within your Python project directory. Read more from their [official documentation](https://pypi.org/project/python-dotenv/)

**Environment variables** is the set of key-value pairs for the current user environment. They are generally set by the operating system and the current user-specific configurations.

Python-dotenv helps us work with SECRETS and KEYS without exposing them to the outside world, and keep them safe during development too

Also, it helps in the development of applications following the [12-factor app](https://12factor.net/) principles.

## Installation
```python
#Create a new virtual environment
python3 -m venv venv
#activate
source venv/bin/activate
#install
pip install python-dotenv
```

## Using the python-dotenv module
1. Create a .env file
First, you need to create a new .env file, and then load the name and value of the variables as a key-value pairs:
    ```python
    #.env file
    ID = "12345689"
    SECRET_KEY = "gsabijwjnciiwbjksa"
    ```

2. Create app.py file ,Import and Call python-dotenv
    ```python
    # app.py
    ## importing the load_dotenv from the python-dotenv module
    from dotenv import load_dotenv

    load_dotenv()
    ```

3. Access the Environment Variables
    ```python
    from dotenv import load_dotenv
    import os #provides ways to access the Operating System and allows us to read the environment variables

    load_dotenv()

    my_id = os.getenv("ID")
    my_secret_key = os.getenv("SECRET_KEY")

    def myEnvironment():
        print(f'My id is: {my_id}.')
        print(f'My secret key is: {my_secret_key}.')

    if __name__ == "__main__":
        myEnvironment()
    ```
**Output**
    `
    ID = "12345689"
    SECRET_KEY = "gsabijwjnciiwbjksa"
    `

**KEY-NOTE:** A large number of security vulnerabilities can be resolved by taking care of leaked credentials, and the python-dotenv helps in developing a safer project environment to work with, both, during and after development as well.

**Tip🖊️:** In case you accidentally exposed your secret / key, do not panic because you can always generate a new key. Also, i would recommend generating new keys before deployment as a safety measure.

Be Safe. Happy coding 🎉🎉

Feel free to leave your comment or feedback below. I would love to hear your opinions.
You can also connect with me via [twitter](https://twitter.com/Emma_Donery) and [linkedin](https://www.linkedin.com/in/emma-donery-0831a7188/).
Depreciating My First Package
Tags: node, packages, depreciation, replit
Published: 2021-09-05 19:50:56

> Update: The `replapi-it` package has been passed on to a new owner! [@PikachuB2005](https://replit.com/@PikachuB2005) now has [their own package](https://npmjs.com/package/replapi-it) on the v3 line and chooses to maintain it. It is not related to the previous ReplAPI.it or the ReplAPI.it Project.

Some time ago, I created a post on Dev.to about creating my first package, a NodeJS API for the online IDE Replit. Over the years my skills increased, the knowledgebase increase, and ReplAPI.it got better. We shifted from adding every part of the APIs to creating a package that allows for users to get the data they need without struggling through documentation and ideologies. **The package was depreciated.**

## Why?
The Replit API is crazy and constantly changing, and in our efforts to put every part of it at the disposal of our users we set ourselves up for failure. Every week there was some new error, some change to the site, some new query that threw a wrench in our plans. The situation was [somewhat similar to that faced by the Discord.py devs](https://gist.github.com/Rapptz/4a2f62751b9600a31a0d3c78100287f1). We were blind to everything unless someone asked on the [Discord Server](https://replit.com/discord). In fact our project was never sponsored (or acknowledged for that matter) by anyone on the Replit team. It became a bit of a pain to manage the package, and attempts to make the process easier and [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)er only made the codebase shift more insane.

## Now What?
Well at the current state, the package is unusable and there are no plans by myself to update it. Some community members have used it as a base to create their own versions which I whole-heartedly support. I don't intend on passing the package itself on NPM over to just anyone, but if you update the package to work with the current problems faced by developers then feel free to shoot me an email.

If you want to use the Replit API at it's current state there are a few hurdles. Firstly you need [an HTTPS package](https://github.com/RayhanADev/lightfetch) because the staging domain that allowed HTTP is down and the main site requires HTTPS. The API endpoint is at `https://replit.com/graphql`. Secondly, you need a schema. You can find some of it by look in DevTools in Network Requests, reverse-engineer the ReplAPI.it package, or obtain a copy of the schema from some benevolent member of the Replit Team (or Replit Mods). With these two in hand you can create your own projects with the API.
Patterns to know
Published: 2021-09-05 19:02:05

<sub>Photo by <a href="https://unsplash.com/@judsonlmoore">Judson Moore</a> on <a href="https://unsplash.com/s/photos/patterns">Unsplash</a></sub>

I just found a very interesting [blog](https://jvns.ca/blog/confusing-explanations/) about patterns, with examples.

Maybe, you already know about [Design Patterns](https://en.wikipedia.org/wiki/Design_Patterns), but here the article talk about explanations patterns.


Hope this helps !
Dark VS Code theme with ~50 languages supported
Tags: vscode
Published: 2021-09-05 19:40:10

![Starfall editing a TypeScript file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2woz8ofwjh12377sz8d.png)
(Font: Jetbrains Mono; Icons: Material Icon Theme)

Get it on the Marketplace:

https://marketplace.visualstudio.com/items?itemName=sndst00m.starfall-visual-studio-code
Typescript Utility Pick
Tags: typescript, angular, react, programming
Published: 2021-09-05 19:22:11

Pick<Type, Keys>


Constructs a type by picking the set of properties Keys (string literal or union of string literals) from Type.

```

interface Todo {
  title: string;
  description: string;
  completed: boolean;
}
 
type TodoPreview = Pick<Todo, "title" | "completed">;
 
const todo: TodoPreview = {
  title: "Clean room",
  completed: false,
};
 
todo;


```

reference:Offical typescript docs

Released:
2.1
C# 10 - Guia de Referência: artigos, dicas e exemplos de utilização
Tags: dotnet, csharp, aspnetcore, webdev
Published: 2021-09-05 19:19:35

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

O objetivo deste post é agrupar conteúdos gratuitos como artigos, dicas, vídeos e exemplos de utilização que venho produzindo sobre as **novidades do C# 10**. Esta nova versão da linguagem **C#** integra o **.NET 6**, cujo lançamento está **previsto para o final de 2021**.

---

## Artigos (incluem exemplos de implementação)

[**Novidades do C# 10: Constant Interpolated Strings**](https://renatogroffe.medium.com/novidades-do-c-10-constant-interpolated-strings-a1bb87fd4635)

[**Novidades do C# 10: Global Usings**](https://renatogroffe.medium.com/novidades-do-c-10-global-usings-7e420acbbad6)

[**Novidades do C# 10: File-scoped namespaces**](https://renatogroffe.medium.com/novidades-do-c-10-file-scoped-namespaces-4a8fe88de37a)

[**Novidades do C# 10: melhorias em Records - utilizando sealed com o método ToString()**](https://renatogroffe.medium.com/novidades-do-c-10-melhorias-em-records-utilizando-sealed-com-o-m%C3%A9todo-tostring-5a6ab3666015)

[**Novidades do C# 10: melhorias em Property Patterns**](https://renatogroffe.medium.com/novidades-do-c-10-melhorias-em-property-patterns-e1f9f5320be9)

[**Novidades do C# 10: melhorias no uso de Tuplas**](https://renatogroffe.medium.com/novidades-do-c-10-melhorias-no-uso-de-tuplas-3dea275d51c8)

[**Novidades do C# 10: melhorias no uso de Structs**](https://renatogroffe.medium.com/novidades-do-c-10-melhorias-no-uso-de-structs-f2c9648a1d08)

[**Novidades do C# 10: Record Structs e Readonly Record Structs**](https://renatogroffe.medium.com/novidades-do-c-10-record-structs-e-readonly-record-structs-cff949e1edd2)

[**.NET 6 - Guia de Referência: artigos, vídeos e exemplos de utilização**](https://renatogroffe.medium.com/net-6-guia-de-refer%C3%AAncia-artigos-v%C3%ADdeos-e-exemplos-de-utiliza%C3%A7%C3%A3o-6c548981bf25)

---

## C# 10: conhecendo as principais novidades (Vídeo)

{% youtube x0u-pdSv5j0 %}

Ao longo desta live foram utilizados **exemplos** disponibilizados no seguinte repositório do **GitHub**:

[**.NET 6 Release Candidate 2 + ASP.NET Core + C# 10 (Exemplos de novas funcionalidades) | GitHub**](https://github.com/renatogroffe/DotNet6_RC2-CSharp10_Exemplos)

---

## Referências

[**What's new in C# 10.0 | Microsoft Docs**](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10)
Vlog series on my JSK13Games 
webXR entry 
Tags: javascript, webxr, html, gamedev
Published: 2021-09-05 18:11:56



Js13kGames is a JavaScript coding competition for HTML5 Game Developers. The fun part of the compo is the file size limit set to 13 kilobytes.

Website - https://js13kgames.com/

The following is my webseries on developing my idea for project called Superposition for the WebXR category. Its still a wip but almost finished. Its an Interesting challenge which forces you to think creatively. I'll also do a follow up vid once I've submitted and finished the project. 

##Initial prototyping and idea generation

{% youtube elZN3jQEGSU%}

##Making idea more concrete / finishing initial prototype / implementation of core game mechanic

{% youtube YzvSx_8s8hM %}

##VR Testing and thinking of VR more
{% youtube qbAtQukKh-w %}

The project (still WIP) can be viewed here 
{% github drnoir/Superposition%}
New things in ECMAScript 2021: String.prototype.replaceAll()
Tags: ecmascript2021, javascript, strings
Published: 2021-09-05 18:01:04

---
title: New things in ECMAScript 2021:  String.prototype.replaceAll()
published: true
date: 2021-09-05 18:00:41 UTC
tags: ECMAScript2021,JavaScript,Strings
description: ECMAScript 2021 added replaceAll(), so you can now replace all instances of a substring in a string
canonical_url: https://blog.jws.app/2021/new-things-in-ecmascript-2021-string-prototype-replaceall/
---

This is going to be a pretty quick post.  I was skimming through what is new in [ECMAScript 2021](https://www.ecma-international.org/wp-content/uploads/ECMA-262_12th_edition_june_2021.pdf) and spotted [replaceAll()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll).  It is [already supported in everything except for Internet Explorer](https://caniuse.com/mdn-javascript_builtins_string_replaceall).  Let’s take a look at [a quick example](https://codepen.io/steinbring/pen/yLbEmJd).

{% codepen https://codepen.io/steinbring/pen/yLbEmJd %}

The reference is within [computed properties](https://vuejs.org/v2/guide/computed.html#Computed-vs-Watched-Property) but this definitely does not require [vue](https://blog.jws.app/tag/vue-js/).  As you can see, it works the same as [replace()](https://www.w3schools.com/jsref/jsref_replace.asp) but it just doesn’t stop at the first instance.

Have any questions, comments, etc?  Feel free to drop a comment, below.
Unique Restaurants {Day - 23}
Tags: 100daysofcode, beginners, webdev, javascript
Published: 2021-09-05 17:59:27

#100daysofcode {Day -23}

Hello everyone, today I am adding some new features and updating my food website. On this site, you can search for any food of your choice and you can also find out the details about it. Link  below: 

Preview: https://unique-restaurant.netlify.app

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugc89wn51ijf2319redk.png)
Building API in Rails Series Part 3
Tags: ruby, rails, ror, rspec
Published: 2021-09-05 17:41:15

---
title: Building API in Rails Series Part 3
published: true
description: This is the series of blogs for building api in Rails
tags: ruby, rails, ror, rspec
cover_image: https://developerblogs.github.io/assets/img/api.jpeg
---

Hi there, I just published the third part of **Building API in Rails**. Hope its useful for whoever reads this :) 

<a href="https://developerblogs.github.io/blogs/rails_api_series/01" target="_blank">**:one: Buidling API in Rails Part 1 :rocket:​** </a>.

<a href="https://developerblogs.github.io/blogs/rails_api_series/02" target="_blank">**:two: Buidling API in Rails Part 2 :gem:** </a>.

<a href="https://developerblogs.github.io/blogs/rails_api_series/03" target="_blank">**:three: Buidling API in Rails Part 3 :rocket:​** </a>.
Kivy Setup on 18.04.1-Ubuntu
Published: 2021-09-05 16:54:47

https://medium.com/geekculture/gui-using-python-with-kivy-deploy-it-to-apk-from-any-operating-system-without-virtualbox-fe2268518286


   70  pip3 install --upgrade setuptools
 
   85  pip3 install Cython
   
   87  pip3 install wheel
   90  sudo apt-get install gcc
   92  sudo apt-get install python3-dev
   94  sudo apt-get install python3-dev python3-pip python3-venv python3-wheel -y
  101  python3 -m pip install kivysudo apt install libglu1-mesa-dev freeglut3-dev
  102  sudo apt install libglu1-mesa-dev freeglut3-dev
  107  pip3 install image
  111  pip3 install pygame
My journey into open-source
Tags: opensource, beginners, webdev, writing
Published: 2021-09-05 16:49:31

It all started when I got a message from my sister,containing a link to a post detailing a competition called the Open Source Challenge 2021 hosted by the Open Source Community Africa(OSCA). I'm a newbie software developer, still getting to grips with the different terminologies thrown around in the world of technology. I had been seeing the term "open source" here and there, and I had an idea, but didn't exactly know what it meant.


This was an opportunity to get to know more about what open source meant by actively participating in a challenge, while also standing a chance to win a prize. Naturally, I was excited about this opportunity and proceeded to read some articles about what it meant for a project to be open source and where to start contributing.


Open source refers to projects whose design and implementation is freely available to be modified and shared by anybody. The source code of such projects can be contributed to by anybody interested in the project, after a process of reviewing by the original authors of the project. The changes that can be made by the public to the project are not restricted to code changes only, errors in documentation can also be corrected, as well as addition of more descriptive text to explain the project and what it does.
After learning what open source was and how to get started, I was ready to start contributing. 


I attempted joining the discord community for the open source challenge but I was having some issues with the discord app and logging in. At this point, other stuff came up and I briefly forgot about the challenge. About a week later, my attention got called back to it and I ended up finding a solution to the discord issue and joined the community proper.


The commit message attached to my first pull request did not properly convey the message of the change I made. This was pointed out to me nicely by the project's author, after which I made the requested change. That was a nice bit of learning on how to write meaningful commit messages so the reviewer has proper context when looking through the changes before merging them. I kept contributing to beginner-friendly open source projects, documentation mostly and some code changes too.


Overall, exploring the open source world been a good ride that I hope to continue on. The importance of open source projects cannot be over-emphasized, in that the source code for the project can be gone through if the documentation is not sufficient and the it also improves overall project quality, owing to the fact that mistakes and better implementations can be pointed out by the public.


Thanks for reading🤗!!!
Deploying Spring For Free  Using Glitch
Tags: spring, cloud, glitch, java
Published: 2021-09-05 16:33:32

Spring is widely used as JAVA based application framework. It is reliable and lightweight. It is perfect not only for large application but also for our weekend project. Sometimes we need to take our apps live. Unlike node very few free hosting is available for spring. Among them Heroku is most popular. 

I like to share one more free hosting option for your spring project. Glitch is providing their free service and we are happy to have a service like this. Many node and frontend developer using their free forever hosting services. Since they support maven I searched for spring project. I failed to found any so I tried to configure one. 

## Method 1 :

### Step 1: 
Create your spring project with [Spring Initializr](https://start.spring.io) or any other tools you prefer
 
### Step 2: 
Create a file called glitch.json in your root folder

```
{
  "start": " java -jar target/*.jar",
  "install": "echo 'compiling' && mvn package",
  "watch": {
    "throttle": 500,
    "install": {
      "include": [
        "^pom\\.xml$",
        "\\.java$"
      ]
    }
  }
}
```
### Step 3: 
Upload the project to GitHub and import the project to glitch using git URL. Directly upload the project using glitch file upload is also possible.

 
## Method 2 :

For quick start you can use the remix button / fork button below and customize as you need.

[![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button-v2.svg)](https://glitch.com/edit/#!/remix/https://glitch.com/edit/#!/springboot)

[![Fork](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqrd9zx2gf8rj1rpkz94.png)](https://github.com/atikur-rabbi/spring/fork)


In case you liked this article, you can give a Heart. I would love to hear any feedback and review from you. Please tell me what you liked in the comment section below. Happy Learning!✨
Transferable Skills When Changing Careers
Tags: career
Published: 2021-09-05 16:29:36

One of the hard things about changing careers is the thought of starting over with no experience. That's not necessarily true, though. In 2015, I changed careers. Prior to that, I was a dental technician for 15 years (I made dentures, metal frameworks, and did some crown and bridge work). While preparing for that change, I did the expected thing and spent a lot of time honing my technical/programming skills. But I also spent a lot of time thinking about how that shift was going to work for my family and what that looked like for myself.

Some questions that came to mind were:

- Since I'm starting over, what will that look like financially?
- Will we have to move?
- Am I just throwing away the last 15 years?

I got lucky in landing a 100% remote job with a starting pay of exactly what my ending dental tech. pay was. So, financially, it ended up being a lateral move, but with all the benefits of being remote and not having up uproot my family.

That last question, though, really got me thinking. What do I with this 15 year history I have? From a technical skills standpoint, it's all useless. But I realized not everything was being thrown away.

Let me give a brief explanation of the process in the dental lab. A dentist would send us a script with the instructions along with the impressions of the patient's mouth. We would go through the whole process of creating a denture (or partial, crown, etc.) based on those instructions. While working on the denture, it would typically go between the lab and the dentist's office 2 or 3 times (or more, if something was really problematic) before it was finished. If a problem or question came up, we would call up the dentist to clarify it. Occasionally, a dentist would request a chair side visit with the patient so we could see what was going on and discuss how to proceed.

Let's look at that same process with a twist. A client (dentist) would send us product requirements. As we were creating the product (dentures), there was constant communication with the client and changes to the product as needed to meet the requirements. Sometimes a phone call would suffice, sometimes a visual inspection was easier.

It's an oversimplification of the process, but hopefully it gets the idea across.

Framing my career like that made me realize that a lot of the non-technical skills _do_ transfer. Not only that, but for 8 of those 15 years, I was a lab manager. The people skills, ability to juggle multiple projects, and team building skills learned during those years all directly transferred.

While starting a new career can be daunting, take a look at how previous experience can be applied. The technical aspects may not directly transfer, but there are plenty of other skills that can and do transfer.
Discord Community for Hashicorp Products
Tags: terraform, vagrant, hashicorp, cloudnative
Published: 2021-09-05 16:23:08

Today, I created a Hashicorp Discord community. I want a place to be able to talk with other people interested in the Hashicorp products (Terraform, Nomad, Vagrant...) more synchronously. I'm not affiliated with Hashicorp in any way, and so this is an unofficial server.

Invite link to server: [https://discord.gg/dF28D6nvEh](https://discord.gg/dF28D6nvEh)

The rest of this post will describe what niche this Discord server fills.

## Hashicorp Forum

The [Hashicorp forum](https://discuss.hashicorp.com/) is a great place to get your questions about any Hashicorp product answered by the people who work on them. However, it's very asynchronous. Response time can be quick for the popular products, and a lot slower for some of the other ones. Further, it is mostly just a place with a question/answer format. I don't feel encouraged to talk about the cool projects I'm working on, and be able to chat with people about them.

The Discord server fixes this with the "showcase" channels. If you have a project to link, or you have a cool application, post it! You can then discuss it with others in real-time. So far, there is just a showcase channel for homelab projects. This will expand as other application areas are needed. It might not fit the best for discussing corporate usage, but the HashiStack can be great for casual use as well!

## Webinars, Presentations, and Talks

Hashicorp posts lots of great educational and informative content on [their Youtube channel](https://www.youtube.com/c/HashiCorp/featured). There are recorded live streams, talks from different conferences, and "community office hours". However, comments are turned of for many, if not all of their videos.

This makes it very difficult to build an interest group around the products. I want to talk to people about how awesome I think Nomad is for my use case, but there isn't a place to do this. Hopefully, the Discord server can cultivate this!

## Next Steps

Anyways, this is where my thought process is. It could be that it isn't set up in a very helpful way, in which case, I invite you to recommend changes in the #server-suggestions channel. I hope that in the future I can have a place to get just as excited about Hashicorp products as I am about Kubernetes on other Discord servers.

Hope to see you on the server!