teleren/devto huggingface dataset:
Symfony & Doctrine: Part 3
Tags: symfony, doctrine, php, beginners
Published: 2022-01-02 20:34:05

Previously, I talked about how to create easily an Entity (ex:JOB) using a simple command line `make:Entity` and answering a few question(fields,type…).

This article will be about saving data to, fetching data from, the database.

## Saving Data to DB : 
To do so, we need to use a service provided by **Doctrine**, called **EntityManagerInterface**. The command  `symfony console  debug:autowiring doctrine` shows all doctrine services available.

Type-hint an argument $em to **EntityManagerInterface**, create an Object _(ex $job)_, set all its properties then call _persist_ and _flush_ methods.

![Persist object to Db](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vaawbak5xw2ncbs21nto.png)

Calling _persist()_ method tells **Doctrine** that we want to save the object, no query is executed yet. We call this method as many time as objects that we have, once we call _flush()_ method, Doctrine execute the queries needed to insert to database.

We can check if data has been inserted with : `symfony console doctrine:query:sql 'select * from job'`

![Data persisted to db](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ug9hmxm6nr46jb4ijlsr.png)

## Fetching Data from DB : 
Getting data(objects) from db is even easier, one way to do that is by using **JobRepository** $jobRepo as an argument in our method. 

![Fetch Data from DB](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o6n6emonfvrijtsecg5y.png)

The **repository** class offers many helper methods to get our data from db like : _findBy, findOneBy..._ We can also add custom methods to have complex queries, more about that in my next article. 

Finally, I like to mention that Profiler provides a lot of tools to use when developing an app, for doctrine, it shows all queries executed : 

![Queries in Profiler](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rumd2o2ryy532s80zpda.png)

Thanks for reading and Happy new year :)
Mailet - Create Temporary Emails For Free
Tags: saas, startup, programming, security
Published: 2022-01-06 18:17:03

[Mailet ](http://www.getmailet.com)generates temporary email addresses that expire after one hour. You may use the UI or API to sign up for websites, social media, and read incoming emails. [Mailet’s ](htttp://www.getmailet.com)objective is to help developers with activities that require temporary email capabilities.

You can subscribe to the waiting list here https://www.getmailet.com/.
Coding Grace - Community Partner with Developer Week 2022
Tags: codinggrace, community, diversityintech, conference
Published: 2022-01-06 18:01:52

![DeveloperWeek 2022](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/keraq06xho19c59qntwg.jpg)
 

We are delighted to be community partner with Developer Week. The DeveloperWeek team has offered our group 25 free OPEN Passes and discounted PRO Passes to the conference so our members can attend the event.

Join 8,000+ developers, engineers, architects, managers, and executives to discover & learn the latest in developer technologies, languages, platforms, tools, and technical management.

[DeveloperWeek 2022](https://www.developerweek.com/), the world's largest developer & engineering conference & expo, is coming up Feb 2-9 (Oakland Convention Center + VIRTUAL).

Join us and discover what’s new in: API & Microservices, AI & Machine Learning, New Coding Languages, Containers & Kubernetes, IoT & Hardware, Developer-Led Innovation, Blockchain/DeFi, Quantum Computing, Product Management & Development, DevOps & DevSecOps, Technical Leadership & Management, Cloud-Native Development, Edge Computing, and more...

### 👉 [Register now to get your free OPEN Pass or to SAVE $100 on your PRO Pass.](https://www.eventbrite.com/e/developerweek-2022-registration-164532975559?discount=MU11808&utm_campaign=MU11808&utm_source=meetup&utm_medium=email)
How to delete remote commits in git?
Tags: github, git, devops
Published: 2022-01-06 18:00:54

Assume you have pushed commits in order A1 => B2 => C3 in remote repository.

Now you want to delete commits C3 and B2.

The simple solution is as follows using  `git reset`

```
 git reset --hard <A1-commit-id>
 git push -f origin <branch-name>
```

However, you should avoid doing this if anyone else is working with your remote repository and has pulled your changes C3 and B2.

That's where `git revert` comes in

```
git revert --no-commit C3
git revert --no-commit B2
git commit -m "commit message for your reverts"
```
**Avail My IT Services on** [https://danyson.netlify.app/](https://danyson.netlify.app/)
[BTY] Day 11: Explain the shell command
Tags: betterthanyesterday, productivity
Published: 2022-01-06 17:44:51

I've just found an interesting website: 

https://explainshell.com

It will explain each argument in your command in a really-easy-to-understand way!

Give the following command a try!

```
du --max-depth=1 -ah /home | sort -n -r | head -n 20
```
Virtual DOM, diffing- algorithm, Context API
Tags: javascript, react
Published: 2022-01-06 17:40:57

**DOM**: 
	DOM stands for Document Object Model. It is the hierarchical representation of your web page(UI). It’s a programming interface of XML or HTML documents. It represents our webpage as we can easily modify it using the programming language.
Each time something in the DOM changes. Since DOM is represented as a tree structure, It contains a node for each UI element present in the web document. It is very useful as it allows web developers to modify content through JavaScript, also it being in structured format helps a lot as we can choose specific targets and all the code becomes much easier to work with

**Virtual DOM**:
	Virtual DOM is the copy of real DOM that kept the original DOM in the memory and synced with the real DOM by libraries such as ReactDOM. This process is called Reconciliation. Changing virtual DOMs is easier than real DOM. 

**Diffing-Algorithm**: 
	A diff algorithm outputs the set of differences between two inputs. These algorithms are the basis of a number of commonly used developer tools. Yet understanding the inner workings of diff algorithms is rarely necessary to use said tools.
React Two virtual trees need to be maintained at the same time DOM Trees ： A tree representing the present DOM structure , The other one is React Generated when the state change is about to be re rendered .React By comparing the differences between the two trees , Decide if it needs to be changed DOM structure , And how to modify . This algorithm is called the Diff Algorithm .

**Context API**: 
	In React props passing into the component is a little bit difficult because In a typical React application, data is passed top-down (parent to child) via props. 
In that situation we need something to handle this problem. Sometimes we need to pass data into many more components. In that case React gives us a Context API to solve this problem. By using Context API we can share props to any components as we want without any difficulties.
10 devtools for 2022
Tags: productivity, webdev, beginners, discuss
Published: 2022-01-06 17:38:32

## Roundup of devtools for a more productive 2022

[We outline the suite of tools our R&D team uses. 
](https://swimm.io/blog/swimm-top-devtools-our-picks/) 
What tools do you use? What did we miss?
AWS Roadmap
Tags: aws, cloud, beginners
Published: 2022-01-06 17:21:25

Today, we'll take a look at a brief AWS roadmap. Our goal is to focus on fundamentals then identify and learn the most commonly used services first and learn specialized services on a need to know basis.

{% youtube yzCx4qvjwgw %}

---

## Summary

Here a summary of the services we'll be discussing.

### Fundamentals

- Regions and Availability Zones
- Identity and Access Management
(IAM)
- Virtual Private Cloud (VPC)
  - Private & Public Subnet
  - Internet & NAT Gateway
  - ACLs and Security Groups

### Frontend

- CloudFront
- Simple Storage Service (S3)
- Amplify
- Cognito
- Elastic Beanstalk

### Backend

**Compute**

- Elastic Compute Cloud (EC2)
  - Auto Scaling Groups
- Lambda
- Lightsail

**Database**

- Relational Database Service (RDS)
- Aurora
- DynamoDB
- ElastiCache

**Networking & Delivery**

- API Gateway
- Route 53
- Elastic Load Balancing (ELB)
  - Application Load Balancing (ALB)
  - Network Load Balancing (NLB)
- Certificate Manager (ACM)

**Integration**

- Simple Queue Service (SQS)
- Simple Notification Service (SNS)
- EventBridge
- Step Functions
 
**Containers**

- Elastic Container Service (ECS)
- Elastic Kubernetes Service (EKS)
- App Runner

**Monitoring**

- CloudWatch
  - Metrics
  - Alarms
  - Log Groups

### DevOps

- Cloud Development Kit (CDK)
- CodeBuild
- CodeDeploy
- CodePipeline

### Data Engineering

- Athena
- Kinesis
- Redshift
- Glue
- Lake Formation

This only scratches the surface of what AWS is capable of! I hope this was helpful, you can find the complete roadmap [here](https://github.com/karanpratapsingh/roadmaps) as well. As always, feel free to reach out anytime!
Resources for Google Maps Platform
Tags: googlemaps, support
Published: 2022-01-06 17:09:50

Everything starts at our [documentation](https://developers.google.com/maps) including links to our other community resources such as [GitHub](https://developers.google.com/maps/developer-community#github), [Discord](https://discord.gg/f4hvx8Rp2q), and [YouTube](https://developers.google.com/maps/developer-community#youtube).

Check our [support page](https://developers.google.com/maps/support) for bugs, technical issues, feature requests, and more!
Complete NestJs JWT Authentication Example with Integration and End-to-End tests!
Tags: typescript, javascript, webdev, tutorial
Published: 2022-01-06 17:04:00

Hi there!

I've previously created a detailed video about jwt authentication in nestjs [here](https://youtu.be/uAKzFhE3rxU).

I initially was not expecting much but apparently the subject of jwt authentication is very popular. Especially when it comes to **access tokens** and **refresh tokens**. I've received a lot of comments and even a PR to my example github repository. ‎😃

I've decided to give back and spent a whole afternoon adding features to the repository showcasing how to use access tokens and refresh tokens in NestJs with **INTEGRATION TESTS** and **END TO END** tests! YAY! ‎😃 ‎😃 ‎😃


![E2E Tests](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sonaodwavfq66ag93utp.png)


![Integration Tests](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/36iqvgygitwjo4pke35a.png)

The repository is here: https://github.com/vladwulf/nestjs-jwts.

I think it will be a solid base for anyone who wants to learn to implement authentication with jwt as there are not a lot of resources on the subject.

The project uses Prisma, argon, a test database for integration and e2e tests with the necessary scripts.

I hope that you will find it useful.

**Any feedback is welcome :)**

Do no hesitate to visit [Code With Vlad](https://www.codewithvlad.com/) for more NestJs content
Testing Ag-Grid React’s Custom Cell Renderer Component
Tags: aggrid, react, testing, cellrenderer
Published: 2022-01-06 17:03:32

I am on a journey to acquire the necessary skills for testing software. I will document the techniques and tricks I learned via blog posts.

[My first post](https://rexebin.medium.com/understanding-unit-test-d34dea63be63) on testing explains what is a unit test and what makes a test good, the knowledge I gained from reading UNIT TESTING: PRINCIPLES, PRACTICES, AND PATTERNS by Vladimir Khorikov.

### Subject Under Test(sut): 
a generic cell renderer component for Ag-Grid React renders any given component of type `FC<ICellRendererParams>`.

### Behaviour
The component being rendered is a small button that uses formatted cell value or cell value as its text. When the user clicks the button, it calls the specified action.

### Code
{% gist https://gist.github.com/rexebin/db539fb5b45c846bc0e64114ecef5488
%}

### Notes

1. the test shows how to use the cell renderer in a `TestComponent`, which is sweet, one of the benefits of testing

1. the test must use the async query `findByText` instead of `getByText`. `findByText` will continuously try to search for the DOM until it finds the element or timeout. `getByText` doesn’t work (button not found error) here because the way Ag-Grid renders its cell renderers.

1. use `userEvent` to mimic the user’s click action, which emits a host of events, same as it happens when a user clicks the button in the browser.

1. the `action` is a spy to get asserted because this is the expected behaviour of the sut. I did not directly assert the other expected behaviour, rendering the button with value as its text. But it is tested because the button is used to trigger the event in the test.

1. no mocks. The test is rendering the `AgGridReact` component and the `Button` component from `@mui/material`

### Side Notes 
The beauty about React is that it embraces functional programming. Its building block is function and encourages the use of pure function. So we can compose simple and pure functions together to make powerful yet simple, elegant and easy to test components.

In this instance, I used a generic cell renderer component to bridge between Ag-Grid’s API and my button component. The useSmallButton hook takes an function and returns a component that uses input. With this generic cell renderer component, I can render anything in a cell. I think Ag-Grid could implement such a generic component to make its API easier to use if not already.

My favourite feature of JavaScript is the spread/rest operator. With this operator, the props of a functional React component is like a contract, an interface, really elegant and powerful.
Hello guys 
Tags: node, react
Published: 2022-01-06 16:40:05

I'm new in Cpanel I have project for both Backend using NodeJS and ReactJS for frontend it's already deploy to cpanel but I was facing a problem that the Github account couldn't deploy the last commits cuz it gave me an error "🎉 Deploy Frontend (Test Server)
The job running on runner Hosted Agent has exceeded the maximum execution time of 360 minutes."
so, I guessed I had to make new repo and mirror the previous repo to the latest one for both backend and frontend with 3 Branches ,
 so how can I upload the backend and frontend to cpanel
How to earn money with your raspberry pi
Tags: raspberrypi
Published: 2022-01-06 16:35:59

[Read original article on gkdv.net](https://gkdv.net/earn-money-with-raspberry-pi/)

How to earn money with a raspbery pi? It's simple, with [earnapp](https://earnapp.com/i/dp64i9n).

## What do you need 
- a [raspberry pi](https://amzn.to/3dV7a4S) (of course ;))
- a [earnapp.com account](https://earnapp.com/i/dp64i9n)

## How to install?
At first, register on [earnapp](https://earnapp.com/i/dp64i9n). It's free and fast. Next, you have to install the earnapp client on your raspberry pi:
``` bash
wget -qO- https://brightdata.com/static/earnapp/install.sh > /tmp/earnapp.sh 
sudo bash /tmp/earnapp.sh
```  

After the install, you obtain a device id to copy/paste on your earnapp dashboard. 

## How does it work
Your raspberry pi will be used as a scrapper by big companies. The more your bandwith will be used, the more you will earn. Nothing to do after install.

I actually earn 0,50€ per day. Not a dream, but on a month, it's best than nothing. You will be paid by paypal, when you reach 5$. I really received the payment :)

Try it on [earnapp](https://earnapp.com/i/dp64i9n)!
Blog Post #10
Published: 2022-01-06 16:05:04

It has been a few weeks since I have made a post on my learning.  So far I have received a couple of certificates in JavaScript, HTML, and CSS.  I still believed I have a lot to learn.

The pic below has helped me to understand the structure especially when I was creating my web page with my mentor Gino.  For those that are starting out and are completely lost like I was late in 2021 this will be greatly in how HTML works.


![HTML structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylrg9v49kcsbigkqnmh2.png)
A map for Machine Learning on AWS (January 2022 edition)
Tags: machinelearning, aws
Published: 2022-01-07 14:13:49

---
title: A map for Machine Learning on AWS (January 2022 edition)
published: true
date: 2022-01-06 15:59:16 UTC
tags: machinelearning,aws
canonical_url: https://julsimon.medium.com/a-map-for-machine-learning-on-aws-january-2022-edition-93febbc1ec39
---

It’s that time of the year again! AWS re:Invent 2021 is over, and it’s time to update my maps once again:

- Overall map for all AI and ML services,
- Model deployment map,
- SageMaker map.

As usual, you’ll find the latest [XMind](https://www.xmind.net/) and high-resolution PNG versions on Gitlab: [https://gitlab.com/juliensimon/awsmlmap](https://gitlab.com/juliensimon/awsmlmap).

Enjoy, and please let me know if I forgot anything.

![](https://cdn-images-1.medium.com/max/1024/1*k9j1a3G3GOvF_1LUtwOKrQ.png)
Looking Back at 2021
Tags: webdev, productivity, career, a11y
Published: 2022-01-06 15:13:20

Going into a two year-plus pandemic I wanted to stay extremely busy, so immersed myself in a lot of different groups and projects. I put myself out there and was able to get over a fear of public speaking.

I had goals for 2020 set, before everything went south and we all locked ourselves away for a year. I accomplished more than what I had planned and some things I did at the drop of a hat with no preparing or planning.

I had been a member of the [W3C](https://w3.org) and would just sit in meeting and not say an awful lot. Just a hello and introduction to who I was.

I felt a huge amount of imposter syndrome sitting in meetings with folks from Microsoft, Oracle, Google, etc. There I was, just some random nobody who was trying to keep busy.

As time went on and I got more comfortable with meetings and talking with people who were just like me. Human beings. I was able to open up and contribute what I could and interact more. About two (maybe more) weeks ago, I was finally approved for the title of Invited Expert, which was something I had on my list of goals.

Strike one goal off the list and mark it accomplished.

Some other accomplishments:

- Spoke at a few virtual conferences.
  - BarCamp Philly (the first I ever spoke at)
  - #a11yTOConf
  - Web Directions AAA
- I spoke at ConnectTech in Atlanta. (First live talk ever)
- Wrote articles for Smashing Magazine and CSS-Tricks
- Appeared on [a bunch of terrific podcasts and livestreams](https://toddl.dev/events/).
- [Started a podcast](https://youtube.com/frontendnerdery).
  - Producing audio and video versions.
- Moved from Maine to Arizona.
- Underwent two surgeries.
- Was named Smashing Magazine's Person of the Week
- Celebrated leveling up to Level 50 on my level up day (birthday).
- Worked at an amazing company, with some amazing people at [Knowbility](https://knowbility.org).
- Moved on to my current role as Accessibility Engineer at [WebstaurantStore](https://webstaurantstore.com)
- Started a podcast about accessibility and code with Homer Gaines.

2022 is going to be a busy year, so I best get back to getting to it. I pat myself on the back for what I accomplished and for whatever you did in 2021, give yourself a pat on the back as well. You deserve the kudos.

Photo by <a href="https://unsplash.com/@marcojodoin?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Marc-Olivier Jodoin</a> on <a href="https://unsplash.com/s/photos/reflection?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Top 10 Best Python Frameworks for Web Development in 2022
Published: 2022-01-06 15:10:55

**Top 10 Best Python Frameworks for Web Development in 2022**
In this blog, i have discussed about Top 10 Best Python Frameworks for Web Development in 2022. Most Popular 10 Best Python Frameworks for Web Development in 2022

1: Django
2: Pyramid
3: CherryPy
4: Flask
5: Bottle
6: Falcon
7: Web2Py
8: TurboGears
9: Hug
10:Tornado

To read the full blog, click on the link above or search my website (**CodesAshish**) on Google. I use to upload blogs related to programming and coding on my website. So Please visit once.

**Thankyou**
Top 5 Technologies You Must Know in 2022
Tags: webdev, ai, machinelearning, blockchain
Published: 2022-01-06 14:52:23

**Top 5 Technologies You Must Know in 2022**
In this blog, i have discussed about Top 5 Technologies to know in 2022. Most Popular Technologies to Learn in 2022.

1: Artificial Intelligence
2: 5G Network Technology
3: Blockchain
4: AR & VR
5: Cyber Security

To read the full blog, click on the link above or search my website (**CodesAshish**) on Google. I use to upload blogs related to programming and coding on my website. So Please visit once.

**Thankyou**
My 2022's goals
Tags: career, goals, programming, discuss
Published: 2022-01-06 14:50:58


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

This year I've made up my mind to share with the community my goals (both personal and as a developer) :

[x] 🚬 Stop smoking (i've already stopped 3 months ago)
[ ] 📕 Learn Node Js + TS
[ ] 🚀 Learn and start to use Laravel or Symfony
[ ] 🐰 Learn and start to use Redis and RabbitMQ
[ ] 🏋️‍♀️ Lose 10kg by go to the gym
[ ] 🧑🏼‍💻 Learn and study design patterns ( i think that they will give me a broader vision when developing)
[ ] 🛩 Work from some Europe country at least for 1 week
[ ] 📆 Join and attend some Meetup and workshop
[ ] 💪🏻 Improving both professionally and personally

What are your goals? Are you trying to achieve them?