teleren/devto huggingface dataset:
Hexagonal Architecture in Python
Tags: python, presentation, architecture, ddd
Published: 2022-10-25 06:30:35

---
title: Hexagonal Architecture in Python
published: true
date: 2022-10-24 18:11:00 UTC
tags: python, presentation, architecture, ddd
canonical_url: https://blog.dornea.nu/2022/10/24/hexagonal-architecture-in-python/
---

What do have clean, layered, [hexagonal](https://brainfck.org/t/hexagonal-architecture) hexagonal, onion architecture and ports & adapters in common? They kind of share the same principles: Separation of concerns (business vs infrastructure code), data encapsulation ([information hiding](https://brainfck.org/t/information-hiding)),[low coupling](https://brainfck.org/t/solid#open-close-principle), strict dependency flow (how layers should depend on other ones).

Still these concepts are not easy to digest unless you put them into practice. Furthermore architectural decisions are figured out based on personal, past experiences and the degree of knowledge people have when discussing viable solutions.

![Figure 1: View presentation](https://blog.dornea.nu/posts/img/2022/hexagonal-architecture/hexagonal-architecture-presentation.png)
<figcaption align = "center"><b>View <a href="https://slides.dornea.nu/2022/hexagonal-architecture/">presentation</a></b></figcaption>

As already mentioned in [Accelerate](https://brainfck.org/book/accelerate) architectural decissions and effective architecture enable teams to easily test and deploy individual components/services also when the organization grows or the amount of services changes. Architectural characteristics rather than implementation details were more important in order to have a portable and sustainable architecture. As you define (logical) layers, clear boundaries and relationships between individual packages/modules inside your software, this will improve overall maintainability and testability of your code.

Some months ago I gave a presentation on “[Hexagonal Architecture in Python](https://slides.dornea.nu/2022/hexagonal-architecture/)” for the TECH team at **Cashlink**. More than a year ago, me and my ex-colleagues at **Scout24** were implementing small services using the same principles, but in[Golang](https://brainfck.org/t/golang). At that time I’ve found it rather easy to find examples for Golang. For [Python](https://brainfck.org/t/python) I still miss examples of big projects embracing hexagonal architecture. (But maybe because I didn’t search as long as I did with Go … )

In [this presentation](https://slides.dornea.nu/2022/hexagonal-architecture/) I somehow mix “hexagonal architecture” and “ports & adapters” for architecting an application meant to upload documents to several storage systems (S3, Dropbox etc.) Let me know if you think this is useful and/or abstractions (as interfaces) are somehow obsolete in Python making code even unreadable.
Opportunities in web3 - Sandbox
Tags: web3
Published: 2022-10-24 17:56:57

**What is Sandbox?**

Imagine a decentralized city with engineers, creators, and entertainers across the world building together. Powered by resources they could utilize across borders to build together. 

This is already possible with the internet. But it is scattered. LinkedIn, Upwork, Fiverr. The growth of that possibility is shrunk today by slow moving currencies and middlemen with fees.

Today, our community is building Sandbox. A *career network* with educational courses, job opportunities, and opportunities to raise capital via web3. 

- Our first campaign is working alongside early college students to find rewarding work experience.
- Our second campaign recently rolled out to build resources like smart-contracts to create a fair and trust-less (no need to trust the other, code is law) transaction environment between users.
    - These contracts are to create a decentralized incentive network of users that could act as “jury” when needed and rewarded by the network. Like Ethereum today rewards validators for signing transactions.


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

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

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

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

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

**Sandbox hopes to serve educators, engineers, creators, and organizations** regardless of their borders via web3 technologies. **Every person deserves an opportunity to pursue their dream**.

If you're curious about what we're doing - 
{% embed https://youtu.be/gDu8UVrF-jo %}
If you have more questions or want to join - {% embed https://discord.gg/uTrhxFy49M %}
JavaScript and its Form
Published: 2022-10-24 17:48:40

A submission form is a form used to collect a users files and data allowing a website or program to receive a file from a user. When building my JS project using a form was the way I was able to add things to my application.

The form submission event uses the .addEventListener and the submit event. Once the form is grabbed they are both added to it. The next thing to think about is the forms default action to refresh the page when the submission is handled, to remove that behavior so it won't be refreshed the .preventDefault method is then added to the event.

```
form.addEventListener("submit", addPlace)
```

My next steps were. to create an element for the input values to be store in and assign it the desired attributes.

```
function addCreateForm() {
    const formContainer = document.getElementById("form-container");
    const form = document.createElement("form")
    form.innerHTML = `<input id="name-input"
```

When that's completed that new element was then appended to the form container previously grabbed.

At the time then event listener was added a callback function was as well, this function holds the code for the POST request needed to add our new element/s to the page. This function sends a fetch request to the backend database after setting variables for the targeted element then sends that POST request form the user values inputed in the form. 

The new world that is JavaScript has many steps as I've learned but through different event listeners like the submit event for forms, you get a pretty good idea of just how much can de done with all the events available to be used.
The new Alexa?
Tags: python, ai, programming
Published: 2022-10-24 17:27:04

Before I start, this is my first ever post. So if you don't like it, please let me know how I can improve. Anyway, I kind of exaggerated in the title, but it's a hobby project I made. https://github.com/Akul-AI/akulai-core_v1 is the link to it. I based it off of Kevin McAleer's voice assistant tutorial, and am adding a lot of new features currently. If you can, please check it out and contribute, or just fork it and go nuts! With much love, Akul.
🖥 Markdown for Entry-Level Web Developers: Learn It Today
Tags: webdev, beginners, github, writing
Published: 2022-10-24 17:14:37

*As an entry-level web developer, have you learned Markdown?*

**Personally, I never considered learning Markdown until I realized how important it is to:**

- Build my projects in public
- Write documentation for each project; and
- [Design my Github profile READ.ME](https://www.youtube.com/watch?v=qic8fpuCN2E) ~~and make it pretty~~

So, in this post, I'll share about what I've learned about Markdown and why it's important for us to learn it as web developers.

>"Web development is a constant learning process. Embrace it and enjoy the journey!" - Candice Zakariya

---


##But What Is Markdown Anyway?

Markdown is a lightweight markup language with plain text formatting syntax. 

With Markdown, you control the display of the document by formatting words as with a few non-alphabetic characters thrown in.

**Here are a few examples:**

- **Bold** ▸ `**bold**`
- *Italic* ▸ `*italic*`; and
- `Code blocks` ▸ ``code block``; and
- ~~Strikethrough~~ ▸ `~~strikethrough~~`

And there are certainly other elements, like headings, images, horizontal rules, creating lists, and block quotes you can do with Markdown. 

##How Do You Create Markdown?

When you create a Markdown file, it is saved as a plain text file, most often with the .md file extension. 

**This plain text can be easily converted into HTML, which can then be displayed in a web browser, using a Markdown processor.**

*All you need to do is save your Markdown text file with the .md extension and then run it through a Markdown processor to convert it to HTML.*

There are many different flavors of Markdown thanks to the various abilities of the different Markdown processors that have been created over the years. 

**Tip:** There are tutorials on how to use Markdown for Github and Dev.to that I'm finding helpful.

##Why Should You Use Markdown?

As an entry-level web developer, it is essential to learn Markdown language. 

**Markdown is often used in the following 3 types of content:**

1. Format README files (like we see on Github)
2. Write messages in online discussion forums; and
3. Create rich text using a plain text editor

From generating website content to creating email templates, Markdown is a versatile tool every professional web developer should know.

Let's be professional!

##Where Can You Learn Markdown?

I learned Markdown with [Scrimba's interactive Markdown Course](https://scrimba.com/learn/markdownblog) in less than an hour.

**But here are some *free resources* I found on YouTube are interested:** 

- Traversy Media's [Markdown Crash Course](https://www.youtube.com/watch?v=HUBNt18RFbo)
- Faraday Academy's [Learn Markdown in 30 Minutes](https://www.youtube.com/watch?v=bTVIMt3XllM)
- Microsoft's [Using Markdown to Optimize your GitHub Project](https://youtu.be/yPAvSZlFBhU) *I'll be on this one soon!*

Go ahead and learn it today! I did and as a result, I was able to create this blog post in Markdown.

Now, I'm off to add this new skill to my resume!
Working with SSG Docusaurus
Tags: opensource, javascript, webdev, github
Published: 2022-10-24 17:08:15

Hi !

This week, I've been working with open source static site generator SSG called **Docusaurus** build with React.

Setting up [Docusaurus project](https://mnosov622.github.io/docusaurus-sample/) wasn't hard.

### Feature

Docusaurus has dark and light modes for their website. It allows users to adjust website look based on their preferences, which gives user better UX. 

I decided to take this feature from them and implement it on my static site generator.

### Implementation

Since, docusaurus is an open-sourse project, then I just copied the icons from them for dark/light modes :)

After that, I added some classes for dark modes and wrote functionality in vanilla JS.

### Last but not least

Another important thing I added to [my SSG](https://mnosov622.github.io/simple-ssg1/dist/index) is that when user refreshes the page, he might lose the preferred mode. Now the selected mode is saved to localstorage.

### Overall 

There are so many great features to take from Docusaurus and in the future I will add more! 

> Software is never done
Return Largest Numbers in Arrays (freecodecamp notes)
Tags: javascript, beginners, webdev, tutorial
Published: 2022-10-24 17:06:48

In this question we are asked to Return Largest Numbers in Arrays.

Tests that we should pass

```javascript
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]) should return an array.
largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]) should return [27, 5, 39, 1001].
largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) should return [9, 35, 97, 1000000].
largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]]) should return [25, 48, 21, -3].
```

**First answer**

```javascript
function largestOfFour(arr) {
 
 let maxInSubArr=0
 let newArr=[]

 for(let i=0;i<arr.length;i++){
   for (let j=0;j<arr[i].length;j++){
         
       if(maxInSubArr<arr[i][j]){
         maxInSubArr=arr[i][j]
         
       }
   }
   newArr.push(maxInSubArr)
   maxInSubArr=0
  
 }

  return newArr;
}
```

**Second answer**


```javascript
function largestOfFour(arr) {

 let newArr=[]

 for(let i=0;i<arr.length;i++){
  
  let maxInSubArr = arr[i][0];

   for (let j=0;j<arr[i].length;j++){
         
       if(maxInSubArr<arr[i][j]){
         maxInSubArr=arr[i][j]
         
       }
   }
   newArr.push(maxInSubArr)
    
  
 }

  return newArr;
}
```
**Correct Answer is Answer 2**, reason being, in the first answer we do not handle negative numbers, we set it to zero initially then reset it to zero once its pushed to return array, however in the second solution we are setting it to the first item in subarray
freedom-01
Published: 2022-10-24 16:59:50

```
vmess://eyJhZGQiOiAic2c1LnZtZXMueHl6IiwgImhvc3QiOiAic2c1LnZtZXMueHl6IiwgImFpZCI6IDAsICJ0eXBlIjogIiIsICJwYXRoIjogIi9KQUdPQU5TU0gvIiwgIm5ldCI6ICJ3cyIsICJwcyI6ICJpdGlzdGVzdC1KQUdPQU5TU0giLCAidGxzIjogInRscyIsICJ0eXBlIjogIm5vbmUiLCAicG9ydCI6ICI0NDMiLCAidiI6ICIyIiwgImlkIjogIjI0MmEzYjcxLTQ1ZjgtNDZkOC1hOGRhLWQ5MjIzZWY5OTg4YiJ9
```
VSCode Remote SSH From the Command Line
Tags: vscode, programming, ssh
Published: 2022-10-24 16:17:37

The [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) extension is very useful for allowing you and edit files remotely.

One awesome feature is allowing you [connect to a remote host from the terminal](https://code.visualstudio.com/docs/remote/troubleshooting#_connect-to-a-remote-host-from-the-terminal).

```
code --folder-uri vscode-remote://ssh-remote+<FQDN><RemoteDirectory>
```

This allows you to create a simple alias to launch VSCode to connect directly to that host.

```
alias devhost="code --folder-uri vscode-remote://ssh-remote+my.example.com/home/example"
```

~~One drawback is you can't currently use hosts from your `.ssh/config` as of now but I've raised a ~~ [feature request](https://github.com/microsoft/vscode-remote-release/issues/7400
) ~~for that~~.

Update: you can use aliases from your `.ssh/config`, either it was bugged or fixed 😅.
An Instagram-clone with my own flavors using Reactjs Expressjs And MongoDB
Tags: javascript, node, mongodb, react
Published: 2022-10-24 16:10:57

backend repository : https://github.com/yassinjouao/instagram-clone-backend
frontend repository :https://github.com/yassinjouao/instagram-clone-frontend

video URL : https://twitter.com/i/status/1584572626504396800

{% embed https://twitter.com/i/status/1584572626504396800 %}
The Top Web Safe Fonts to Use on Your Website 2022
Tags: webdev, beginners, tutorial, productivity
Published: 2022-10-24 16:10:13


![Top Web Safe Fonts to Use on Your Website 2022](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fonbl7wandtstvc42unc.png)
Web Safe Fonts to Use on Your Website. Fonts play a vital role in framing your brand language and website design. Find the most suitable fonts for your websites, where to bring them, and when to add them. To have a wonderful web font that should be readable and safe web-fonts. It affects well across different devices, browsers, and operating systems.

Regardless, selecting the right font is not ever so easy. It’s standard to come across fonts that are visually attractive but aren’t web-safe or vice versa.

## What Is A Web-Safe Font?

Web-safe fonts come pre-installed on most operating systems. It confirms that the font effect is as planned when accessed from different devices and browsers.

The most well-known examples of web-safe fonts include Arial, Times New Roman, and Helvetica.

## What Are The Categories Of Fonts?

There are many varieties and types of fonts, and each deviation has its area relying on your brand. Some fonts are more decorated and prominent, while others are fairly simplistic and universal. 

## Web Safe Fonts To Use On Your Website

Some font types are perfect for a bold, eye-catching title, while others are best used in a lengthy paragraph of text. The different font types are as follows:

1. Sans-serif
2. Fantasy
3. Arial
4. Times New Roman
5. Times
6. Courier,... So on

Read More: [Top 18 Web Safe Fonts to Use on Your Website 2022](https://softcodeon.com/tutorials/web-safe-fonts-to-use-on-your-website.htm)
Verify User Ownership of a Website with dotNet
Tags: dotnet
Published: 2022-10-24 16:01:39

When you have a service that users can use on their website, and you want to verify the site ownership.  Ownership verification means proving to your platform that the user owns a specific website.

Ex. Google ask to verify your website when linking to Google Search Console

## How To Verify site ownership?
Verify ownership of a site by uploading a special HTML file to a specific location on your site. This file is tied to a specific user. 

## Pre-Requisites
- [CodeHelper.Tools.VerifyWebsite NuGet Package](https://www.nuget.org/packages/CodeHelper.Tools.VerifyWebsite/) 

## The Code
### Part 1: Create the verficatonCode
GetVerifyFileInfo() will return the information to create the file.
 
The layout part is only to showcase what you can show to the user

```
using CodeHelper.Tools.VerifyWebsite;

WebSiteHelper _verifier = new() { WebsiteUrl = "https://thedomain.com" };
//-- Get the fileName, fileUrl and fileContent
var (verifyFileName, verifyFileUrl, verifyContent) = _verifier.GetVerifyFileInfo();

//-- Save the contentCode (which will be needed in the second part )
var _saveVerifyCode = _verifier.VerifyCode; //-- Save this code

//-- Layout (Use the variables to return the information to the user)
Console.WriteLine("Copy the html file to the root of your website");
Console.WriteLine("Filename: " + verifyFileName);
Console.WriteLine("Content: " + verifyContent);

Console.WriteLine(Environment.NewLine);
Console.WriteLine($"Check that {verifyFileUrl} is accessible");
Console.WriteLine($"Click Verify WebSite");
```   
   
### Part 2: The user has copied the file to the root directory of the domain
 ```
_verifier = new() { WebsiteUrl = "https://thedomain.com", 
                    VerifyCode = _saveVerifyCode };
if (await _verifier.VerifyWebSite())
    Console.WriteLine("Your website is verified"); //-- Your Next Code
else
    Console.WriteLine("We could not verify your website");

```

## Next (Roadmap)
- Function to download the file directly.
- Verification via meta tag
- Verification via DNS

Don't forget to follow me for updates
[Check out my all my NuGet Packages](https://frederik.today/codehelper/dotnet-nuget-packages)
Best Way to Install OpenStack? OpenMetal vs Manual installation
Published: 2022-10-24 15:46:12

---
title: Best Way to Install OpenStack? OpenMetal vs Manual installation
published: true
description: We are looking into OpenMetal. How to get started and what is included. OpenMetal is a service where you get an OpenStack solution in a box with a Ceph cluster deployed on dedicated hardware.
tags:
cover_image: https://i.ytimg.com/vi/E1LXQd1M-ck/maxresdefault.jpg
---

{% youtube E1LXQd1M-ck %}

We are looking into OpenMetal. How to get started and what is included. OpenMetal is a service where you get an OpenStack solution in a box with a Ceph cluster deployed on dedicated hardware.
Top Skills to learn as college student
Tags: coding, programming, graphicdesign, digitalmarketing
Published: 2022-10-24 15:43:44

**Skill is the key**, did you had any idea about this?
yes,college degree isn't enough for one to find a job now.
even it's an **start-up** or any **MNC** you should be skilled enough to find a job.
so few skills are listed here that you can master while you're in college doesn't matter what you are studying there.
**1. web Development**: web development is one of the most demanding yet fastest growing skill these days here,you learn about web technologies and how does website or web engines works.Web development is divided into three catagories;

- **front-end**:
here you will learn about the _client/user_ side web development technologies like: html,css,javascript.

- **back-end**:
here you will learn about _server_ side web technologies like:
python,node-js and data bases like sql,mongodb etc

- **full stack**:
full stack is something where you will learn both _front-end_ and _back-end_.

**2. social media marketing**: social media marketing is the most demanding skills nowadays, those days are gone where companies used to advertise their products or services through pamphlet or banner,time has changed enough now, like everything is getting online so the businesses are also going online to make  it more profitable and in order to do that one must need some online medium to advertise their products/services through the internet. And social media marketing is making it possible through **instagram marketing**,**facebook marketing**,**SEO(search engine optimization)**, **youtube marketing**. Businesses advertise there products/services through social media posts,ads and events
you can learn marketing skills there to optimize it digitally. 

**3. Graphic Design**: graphic design is something where you make some design graphically and you will learn about design process,ideas, color pallets etc.designs of advertisement banners or pamphlet but now graphic design is not only used for making banner or pamphlet but in addition it is also used to make social media posts where organizations advertise their products/services online.they make an attractive looking page which has fonts,color,icons,mascots, etc where they list their features and offers to promote the product.
We passed the 6000 member mark 💥
Tags: opensource, thankyou, programming, luos
Published: 2022-10-24 15:42:08

💥 Woo-hoo! We opened a new community a few months ago for embedded and edge developers and have passed the 6000 member mark!

Thanks to all of you maintainers, contributors, communicators and members for being part of this great project!

This Discord aims to exchange with embedded and edge developers on new project development methodologies [join now](https://discord.gg/luos)
How to Zip a directory with dotNet
Tags: dotnet
Published: 2022-10-24 15:39:32

Ever seen an online platform allowing you to back up your work and let you download a Zip file?  Shouldn't all platforms offer this ;)  

The good news is that the dotNet framework offers this feature standard with the `System.IO.Compression.ZipFile` static class.    

The class allows you to create, extract, and open zip archives.

This feature is available for a long time, from .NETCore 1.0, .Net Framework 4.5, .NET Standard 1.3, but I don't see it used that often.  That's why I made this article and we are implementing this feature on our Web Stories Today platform. 

## Pre-Requisites
To use the ZipFile class in a .NET Framework app, you must add a reference to the System.IO.Compression.FileSystem assembly in your project.


## Zip a directory
```
ZipFile.CreateFromDirectory(directoryToZip, resultZipFilePath);
```

## Extract to a directory
```
ZipFile.ExtractToDirectory(ZipFilePath, extractPath);
```

## Conclusion
It is s easy, no platform has an excuse not to offer a Zipped backup of your content and work