teleren/devto huggingface dataset:
DevOps for Odoo
Tags: odoo, devops, cicd
Published: 2023-01-20 13:14:35

DevOps is all about shipping code to a running environment. It got a lot of benefits but the major one is to have consistence environment and stop (it works in my machine excuse).
and as I worked with Odoo for a long period of time I took it as an example to create a simple way to backage developer's code as a container.

#### _disclaimer:_
The pipeline created here is not meant to be used in production it's only for simplifying the idea of Devops for Odoo code base.

### The goal:

To create a docker image with the latest changes from git.

### Tools:
1.Github.
2.Docker.
3.Github actions.

- The repo structure is:
- Dockerfile
- extra-addons
  - addon1
  - addon2
  - addon..
  - …….
- odoo.conf
- requirements.txt 
- .github
  - workflows
    - docker-image.yml

_The requirements.txt is only for python modules_

As in [odoo-devops](https://github.com/AlfadilTabar/odoo-devops).

The github action will generate an image with the latest and an image with a hash tag from git.
Like dockermanfirst/odoo-14:latest, dockermanfirst/odoo-14:main-228a04c, you can deploy it on any docker host.

What this structure will guarantee:
Consistency of deployment between environments.
Standard way to deploy the odoo version.
O PHP vai morrer?
Tags: php, webdev, javascript, braziliandevs
Published: 2023-01-20 13:13:07

"O PHP está morto? Não, mas está tão velho que tem uma sessão de terapia para lidar com a sua morte iminente.

Sim, é verdade. O velho e querido PHP, a linguagem de programação que já foi tão popular entre os desenvolvedores, está agora sendo dado como morto. Mas, antes que você comece a chorar no seu teclado, eu tenho notícias para você: ele ainda está vivo e chutando.

É claro, ele não é mais o jovem e saudável garoto que era há alguns anos atrás. Ele tem cabelos grisalhos, usa óculos de leitura e precisa de uma caminhada de 30 minutos antes de iniciar qualquer tarefa. Mas ele ainda está lá.
Inclusive foi minha porta de entrada no mercado de trabalho. No início de 2017 eu dava meus primeiros passos com PHP para integração de uma API de geração de nota fiscal de serviços e produtos.

## E qual é o veredito final?
Não é uma opinião compartilhada por todos na comunidade de desenvolvimento de software, mas alguns argumentam que o PHP está se tornando obsoleto devido ao surgimento de outras tecnologias de back-end mais modernas e poderosas. No entanto, é importante lembrar que muitos websites e aplicativos ainda usam PHP e ele continua sendo uma escolha popular para desenvolvimento web. Portanto, é improvável que o PHP "morra" completamente.
Muitos argumentam que novas tecnologias como Python e Node.js estão rapidamente superando o PHP, mas eu argumentaria que o PHP tem uma história muito longa e rica. Ele tem sido usado para construir alguns dos websites mais populares do mundo, incluindo Facebook e WordPress. Ele ainda é a escolha de muitas empresas e desenvolvedores, e não está prestes a desaparecer tão cedo.
Além disso, o PHP tem sido atualizado e melhorado ao longo dos anos. Ele agora tem recursos modernos, como suporte a orientação a objetos e melhorias de desempenho. Ele ainda pode ser usado para construir aplicações web incríveis, e não deve ser descartado tão facilmente.
Então, o PHP está morto? Não. Ele está apenas envelhecendo com graça e sabedoria. Ele ainda tem muito a oferecer, e não deve ser subestimado. Então, vamos dar uma chance para o nosso velho amigo PHP e ver o que ele ainda pode fazer."
Create a new Customer Master Key (CMK) in Key Management Service (KMS) and encrypt an object
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-01-20 12:57:51

[20/100] #100DaysOfCloud Today, I created a new Customer Master Key (CMK) in Key Management Service (KMS) and encrypted an S3 object.

- AWS Key Management Service (AWS KMS) lets you create, manage, and control cryptographic keys across your applications and more than 100 AWS services.
- Use AWS KMS to encrypt data across your AWS workloads, digitally sign data, encrypt within your  applications using AWS Encryption SDK, and generate and verify message authentication codes (MACs).
- Symmetric encryption – uses a single key for both encryption and decryption. The shared key must be sent together with the encrypted data in order for other parties to read it.
- Asymmetric encryption - it uses a public and private key for encryption and decryption. The public key is used only for encrypting data and the private key is only used for decrypting data. The private key stays on the user while both the public key and the encrypted data is sent to other parties.
- The KMS keys that you create are customer managed keys. Customer managed keys are KMS keys in your AWS account that you create, own, and manage. You have full control over these KMS keys, including establishing and maintaining their key policies, IAM policies, and grants, enabling and disabling them, rotating their cryptographic material, adding tags, creating aliases that refer to the KMS keys, and scheduling the KMS keys for deletion.
- AWS managed keys are KMS keys in your account that are created, managed, and used on your behalf by an AWS service integrated with AWS KMS.
- AWS owned keys are a collection of KMS keys that an AWS service owns and manages for use in multiple AWS accounts. Although AWS owned keys are not in your AWS account, an AWS service can use an AWS owned key to protect the resources in your account.

You can try to create a new Customer Master Key (CMK) in Key Management Service (KMS) and encrypt an S3 object by yourself by following the steps from the link below:
[GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/020/Readme.md)
Build a music player with YouTube IFrame Player API
Tags: typescript, react, youtubeiframeapi, reactyoutube
Published: 2023-01-20 12:56:36

I added a musicplayer based on  YouTube IFrame Player API for my [personal site music page](https://www.eliaschen.dev/music) to play my playlist from YTmusic.
### Stack
- React as a framework
- YouTube Data API v3 (fetching music list from youtube)
- [react-youtube](https://www.npmjs.com/package/react-youtube) Youtube iframe player for react

### react-youtube
[Installation](https://www.npmjs.com/package/react-youtube)

Add player config.
```js
import YouTube from 'react-youtube';
const opts = {
  height: "250",
  width: "350",
  playerVars: {
    autoplay: 1,
  },
};
```
Add player from react-youtube.
```js
<YouTube
  videoId={"UEx5T0xfUk1td3F5ZFJ0elRhVHV6SGM3R0NYbEFSMmFPOC5EMEEwRUY5M0RDRTU3NDJC"} //Video id from youtube
  opts={opts}
/>;

```
Create a control player event value
```ts
let videoElement: YouTubePlayer = null
```
Player event control like:`pauseVideo()`, `playVideo()`\
Example of video play button:
```jsx
<button onClick={()=>videoElement.target.playVideo()}>
     Play Video
</button>
```
### PlayList
Create a API token on [google api console](https://console.cloud.google.com/apis/dashboard), search and add **YouTube Data API v3**.
```js
import React from 'react';
const [loading, setLoading] = React.useState(true);
const [playList ,setPlaylist] = React.useState(null);
React.useEffect(() => {
  setLoading(true);
  fetch(
    "https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=PLyOL_RMmwqydRtzTaTuzHc7GCXlAR2aO8&key=<your_api_token>&maxResults=1000",
    {}
  )
    .then((res) => res.json())
    .then((data) => {
      setPlaylist(data.items);
      setLoading(false);
    });
}, []);
return (
  <ul>
    {loading || !playList ? (
      <h1>Loading...</h1>
    ) : (
      playList.map((items) => <li key={items.id}>{items.snippet.title}</li>)
    )}
  </ul>
);
```
Source code: [Github](https://github.com/chenelias/eliaschen.dev/blob/main/pages/music/index.tsx)
Website: [Personal site](https://www.eliaschen.dev/music)
⚡Thanks for reading, see you in the next blog.
Top 10 Web & Mobile App Technologies in 2023
Tags: react, angular, vue, node
Published: 2023-01-20 12:50:09


**1. React Native:**
This is a popular open-source framework for building mobile apps using JavaScript and React. It allows developers to create apps that are compatible with both iOS and Android platforms, without the need for separate codebases.

**2. AngularJS:** 
This is a JavaScript-based framework for building dynamic web applications. It is widely used for building complex, single-page web apps and is supported by Google.

**3. Vue.js:**
This is a progressive JavaScript framework for building user interfaces. It is lightweight, easy to learn, and has a small footprint, making it a popular choice for building web apps.

**4. Node.js:**
This is a JavaScript runtime environment that enables developers to build server-side applications using JavaScript. It is fast, efficient, and can handle a large number of connections simultaneously.

**5. Laravel:**
This is a PHP-based web application framework that is known for its elegant syntax and powerful tools. It is widely used for building web apps, and is a popular choice among PHP developers.

**6. Ruby on Rails:**
This is a web application framework written in Ruby. It is known for its convention over configuration approach, which makes it easy to build web apps quickly.

**7. React:**
This is a JavaScript library for building user interfaces. It is often used in combination with React Native for building mobile apps, and is also used for building web apps.

**8. Django:**
This is a high-level Python web framework that allows developers to build web apps quickly. It is known for its batteries-included approach, which provides developers with a wide range of tools and libraries.

**9. Flutter:**
This is an open-source mobile app development framework created by Google. It uses the Dart programming language and allows for the creation of high-performance, visually attractive apps for both iOS and Android.

**10. Xamarin:**
This is a Microsoft-owned open-source framework for building mobile apps using C# and the .NET framework. It allows developers to share code across iOS, Android, and Windows platforms.

These are some of the top technologies for web and mobile app development in the market. Each of them has its own strengths and weaknesses, and the choice of technology will depend on the specific requirements of the project.
⚡ Introduction to Next.js
Tags: nextjs, react, javascript, tutorial
Published: 2023-01-20 12:44:01

## What is Next.js ?

Next.js is a **flexible web framework** built on **React.js** that provides a lot of functionality to create **high-performance applications**.

## More about Next.js

Next.js offers a **better developer experience**, with several features you need to take your project to production:

- Hybrid rendering (static and server)
- TypeScript support
- CSS-in-JS (Styled components, Styled-JSX)
- Zero Configuration (Routes, Hot Reloading)
- Optimization of Images and Fonts
- Optimized for Production

## Some Companies that use Next.js

- Tiktok
- Github
- Twitch
- Nike
- Uber

You can see more companies that use next at this link: https://nextjs.org/showcase

## Get started

You can use React to build your user interface and gradually adopt Next.js features to solve common application requirements like routing, data fetching and integrations.

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

You can use create-next-app to create a project in Next, it automatically configures everything for you.

`npx create-next-app@latest --typescript`
`yarn create next-app --typescript`

## Useful links

If you want to know more about Next.js
Below are some useful links for you.

- Official website (https://nextjs.org/)
- Documentation (https://nextjs.org/docs/getting-started)
- What's New in Next.js 13 (https://nextjs.org/blog/next-13)
C++ — programming language of the year 2022. What about other languages?
Tags: programming, news, discuss
Published: 2023-01-20 12:42:37


![1026_TIOBE_2022/image1.png](https://import.viva64.com/docx/blog/1026_TIOBE_2022/image1.png)

Overtaking Python, C\+\+ became the TIOBE's language of 2022\. It outscored Rust, C\#, Go and others by a large margin\. Don't you find this weird? Well, let's figure this out\.

The rating we're talking about is based on the [TIOBE](https://www.tiobe.com/tiobe-index/) index\. Here's the table of the 20 most popular languages for January 2023:

![1026_TIOBE_2022/image2.png](https://import.viva64.com/docx/blog/1026_TIOBE_2022/image2.png)

Here's the main question: why is C\+\+ the language of 2022? According to the table, Python takes the first place in the rating\.

Here's the answer: TIOBE chose the winner by the growth of the language popularity\. In this regard, C\+\+ is ahead of the curve\. 

Here's the top five leaders in popularity growth: 

* C\+\+ \(\+4\.62 %\)
* C \(\+3\.82 %\)
* Python \(\+2\.78 %\)
* Java \(\+1\.55 %\)
* JavaScript \(\+0\.78 %\) 

TIOBE gives several reasons explaining C\+\+'s growing popularity\. Although C\+\+ is an OOP language, it provides excellent performance\. Moreover, ISO constantly releases new standards\. TIOBE points out that the language started going uphill since the C\+\+11 publication\. They also suppose that C\+\+20 which introduced modules will probably lift C\+\+ further in the TIOBE index in the next few years\.

Here are a few more curious results from the TIOBE index:

* Rust entered the Top 20 again \(from \#26 to \#18\);
* F\# jumped from position \#74 to \#33;
* Lua jumped 6 positions from \#30 to \#24;
* Kotlin jumped from \#29 to \#25\. 



Here are some thoughts that crossed my mind after viewing the table and reading the article:

* Visual Basic takes position \#6 — wait, what?\! It's amusing to compare the absolute rating of VB \(4\.64%\) with Go \(1\.14%\) and Rust \(0\.61%\)\.
* It's a pity that C\# gets only \+0\.05%\. That's a scanty increase \(especially when comparing it with Java\)\.
* I feel happy for F\# — it made a great jump\!
* Some people are skeptical about TIOBE ratings because of the way they calculate the popularity of languages\. And that's a fair point\. The Visual Basic position in this index kind of suggests that their algorithm of choosing a language is not perfect\. Well, perhaps C\# has actually become more popular, who knows\.
* As Bjarne Stroustrup said: "There are only two kinds of languages: the ones people complain about and the ones nobody uses\."
* In case you're curious to learn about the most interesting bugs in projects written on different programming languages, here you are:
  * [Top 10 bugs found in C\# projects in 2022](https://pvs-studio.com/en/blog/posts/csharp/1020/)
  * [Top 10 bugs found in C\+\+ projects in 2022](https://pvs-studio.com/en/blog/posts/cpp/1021/)



What are your thoughts on the rating?
Artificial Intelligence
Published: 2023-01-20 12:31:04


Artificial intelligence (AI) is the simulation of human intelligence processes by computer systems. These processes include learning (the acquisition of information and rules for using the information), reasoning (using the rules to reach approximate or definite conclusions), and self-correction. AI technology has advanced significantly in recent years and is being used in a variety of fields, such as natural language processing, image recognition, and decision making.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qmx16fwqvn7sp26bb0hy.jpg)
## What is the difference between Machine Learning and Artificial Intelligence?
 Machine learning and artificial intelligence (AI) are related but distinct fields.

Machine learning is a subfield of AI that focuses on the development of algorithms and statistical models that enable computers to learn from data and make predictions or decisions without being explicitly programmed. Machine learning algorithms are used to identify patterns and relationships in data, and can be used for a wide range of applications, such as image and speech recognition, natural language processing, and predictive analytics. There are different types of machine learning such as supervised, unsupervised and reinforcement learning.

Artificial intelligence, on the other hand, is a broader field that encompasses machine learning, as well as other technologies that enable computers to perform tasks that would typically require human intelligence, such as problem-solving, decision-making, and perception. AI encompasses a wide range of subfields, such as natural language processing, computer vision, robotics, and expert systems.

In short, Machine learning is a subset of AI, and AI is the broader field which includes machine learning as one of its subfields. Machine learning is focused on teaching machines to learn from data and make predictions or decisions, while AI is focused on developing intelligent systems that can perform a wide range of tasks that would typically require human intelligence.
Eisenhower Matrix
Tags: eisenhower, priorititymanagement, powerofpeople, storybytes
Published: 2023-01-20 12:30:13


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utwjx1zdm015g9vq6o6c.png)Data is everywhere and comes in many forms. Today, terabytes and petabytes of data are being generated every second, and finding storage solutions for these massive data volumes is of utmost importance. Complex machines and technologies now collect an incredible breadth of data; this is where the Data Lake and Data Warehouse come in. What are they? Let’s look at them in a none technical way. Date lake can be seen as an open mind, open to many things, many sources, unstructured and more compatible. A data warehouse can be seen as a closed mind; not available to many things, does not allow many sources, and is structured and less compatible. Data warehouses and Business Intelligence tools support reporting and analytics on historical data. In contrast, data lakes support newer use cases that leverage data for machine learning, predictions, and real-time analysis. Data Lake has emerged as a robust platform business can use to manage, mine, and monetise vast unstructured data stores for competitive advantage. As a result, the rate of adoption of Data Lake platforms by companies has increased dramatically. Data warehouses work well for specific workloads and use cases, and data lakes represent another option that serves other workloads. We are at a point now where we will be able to use data not only to review the past but understand the present and even to predict the future. The data and tools will continuously evolve to help us get there in almost real time. In reality, if you can have multiple uses of the same data. And so, you never know what you may use that data for. So, if you start with just getting the data in first and then figuring out what you want to do with it, it generally leads to a more positive outcome with that data.
Unlocking the Power of Promises: Mastering Asynchronous JavaScript with Ease
Tags: javascript, webdev, tutorial
Published: 2023-01-20 12:16:18

# Introduction: 
Asynchronous programming is a fundamental concept in JavaScript, and promises are one of the key tools used to handle it. In this post, we'll take a closer look at what promises are and how they work, and explore some of the ways they can be used to make your code more efficient and manageable.

# What are Promises? 
A promise is a JavaScript object that represents the eventual completion (or failure) of an asynchronous operation, and its resulting value. When you create a promise, you pass it a function called the "executor," which is responsible for starting the asynchronous task and resolving or rejecting the promise once it's complete.

# How Promises Work: 
When you create a promise, it starts in a "pending" state. Once the executor function has completed its task, it can either "resolve" the promise (if the task was successful) or "reject" it (if the task encountered an error). If the promise is resolved, it moves into a "fulfilled" state and any code listening for the promise to be fulfilled will be executed. If the promise is rejected, it moves into a "rejected" state and any code listening for the promise to be rejected will be executed.

# Using Promises: 
Promises can be used to handle a wide variety of asynchronous tasks in JavaScript, such as making HTTP requests, reading from a file, or interacting with a database. One of the key benefits of using promises is that they allow you to write code that is easy to reason about, as you can clearly see where the asynchronous code begins and ends.

## Promise.prototype.then(): 
The `then()` method is used to handle the resolved value of a promise. It takes two arguments, a callback function to execute if the promise is fulfilled, and a callback function to execute if the promise is rejected. You can chain multiple `.then()` methods together to handle the promise value at different stages in your code.

## Promise.prototype.catch(): 
The `catch()` method is used to handle a rejected promise. It takes one argument, a callback function to execute if the promise is rejected.

## Promise.prototype.finally(): 
The `finally()` method is used to execute a callback function regardless of whether the promise is fulfilled or rejected. This can be useful for cleaning up resources or performing other tasks that need to be done regardless of the promise's outcome.

# Conclusion: 
Promises are a powerful and versatile tool for handling asynchronous code in JavaScript. By providing a clear and consistent way to handle the completion (or failure) of asynchronous tasks, they help to make your code more manageable and easier to reason about. Whether you're working on a small personal project or a large enterprise application, understanding how promises work is essential for writing high-quality, efficient JavaScript code.