teleren/devto huggingface dataset:
Advertise with Ease: Introducing Quickads.ai!
Tags: javascript, ai, devops, java
Published: 2024-05-15 19:46:34

Step into the future of advertising with [Quickads.ai](https://www.quickads.ai), your all-in-one solution for effortless ad creation. Say goodbye to the confusion and time-consuming process of designing ads. With Quickads.ai, crafting captivating ads is as easy as a few clicks.

Navigate through a diverse range of templates effortlessly. Unsure of what works best for your industry? Quickads.ai takes the guesswork out by guiding you to select the most aesthetically pleasing and relevant templates tailored to your needs.

But that's just the beginning. Quickads.ai simplifies the process of generating multiple ad variations for testing, allowing you to focus on growing your business while our platform handles the heavy lifting of ad creation.

No matter the platform—Google Pmax, Facebook, Instagram—Quickads.ai supports them all. With over 30 formats to choose from, you'll never need to manually reformat again.

And there's more. Quickads.ai introduces studio-quality AI product photography. Upload an image or describe your product, and watch as Quickads.ai transforms it into astonishing studio-quality visuals, all for less than 10 cents per image. Don't believe it? Check out our gallery and see for yourself.

But we're not done yet. Quickads.ai breaks language barriers with our AI ad copywriter, capable of crafting ads in 35 languages. Connect with your audience globally while resonating locally.

Ready to revolutionize your advertising game? Embrace the power of Quickads.ai today and watch your sales soar.
How to prevent generating new access tokens.
Tags: flask, webdev, python, backenddevelopment
Published: 2024-05-15 19:36:43

My problem is that when I hit the Login API it generates the access token and refresh token. But even when the tokens are valid, when I hit the API again the tokens are generated. I want to prevent that how can I do that? Please help.
Note: I am not sending the token in the Login API request.

```
class LoginView(MethodView):

    def post(self):
        body = request.form
        try:
            name = body.get('name')
            mobileNumber = body.get('mobileNumber')
            email = body.get('email')
            password = body.get('password')


            if not name:
                return jsonify({"error": "Name is required"}), 401

            if len(password) < 6:
                return jsonify({"error": "Password must be at least 6 characters long"}), 401

            if not email and not mobileNumber:
                return jsonify({"error": "Either email address or mobile number is required"}), 401
            
            if email:
                user = User.query.filter_by(email = email).first()
                if not user:
                    return jsonify({"error": "User does not exist, please register"}), 401
            
            if mobileNumber:
                user = User.query.filter_by(mobileNumber=mobileNumber).first()
                if not user:
                    return jsonify({"error": "User doest not exist, please register"}), 401
            
            if (user.name == name.capitalize()):
                if check_password_hash(user.password, password):

                    # Generate access and refresh tokens
                    access_token_expires = timedelta(minutes=30) # Shorter expiry
                    refresh_token_expires = timedelta(days=1) # Longer expiry
                    access_token = create_access_token(identity=user.public_id, expires_delta=access_token_expires)
                    refresh_token = create_refresh_token(identity=user.public_id, expires_delta=refresh_token_expires)
                    
                    return jsonify({
                        'access_token': access_token,
                        'refresh_token': refresh_token
                    }), 201

                return jsonify({"error": "Wrong password entered"}), 401
            
            return jsonify({"error": "User name didn't match"}), 401

        except Exception as e:
            return jsonify({"error": str(e)}), 500
```
Universal Bathrooms
Published: 2024-05-15 19:23:41


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

At Universal Bathrooms, our experienced team begins each day with one goal: to exceed your expectations and earn your trust. With a commitment to excellence and unparalleled customer service, we strive to understand your vision and bring it to life with precision and care. So, why bathrooms? It’s simple math. The average person spends a staggering 182 hours per year in this vital space. It’s the heartbeat of any home, enduring daily wear and tear. And as long as we continue to use them, bathrooms will inevitably need refreshing. That's where we come in, ensuring your bathroom remains a sanctuary of comfort and style. At Universal Bathrooms our mission is simple: to exceed your expectations and leave you saying, “I love my bathroom!” With our expertise and dedication to quality craftsmanship, we transform ordinary spaces into extraordinary retreats, tailored to your unique vision.

Universal Bathrooms
Address: 7989 Oswego Rd, Liverpool, New York 13090
Phone: 3158574913
Website: [https://www.universalbathcny.com/](https://www.universalbathcny.com/)
Contact email: info@universalbathcny.com

Visit Us:
[Universal Bathrooms Facebook](https://www.facebook.com/profile.php?id=61558249485590)

Our Services:
Tub-To-Shower Conversion
Bathtub Replacement and Remodeling
Shower Remodeling
Walk-In Tub Installation
Full Bathroom Renovation
Event Loop javascript
Tags: javascript, webdev, beginners
Published: 2024-05-15 17:32:37



### Event Loop:-
 The event loop is a mechanism in JavaScript that allows the execution of **asynchronous code.** It is a **single-threaded** loop that _**constantly checks for events**_ and then executes the appropriate callback functions.

### Hoisting:-
Hoisting refers to the process where the interpreter appears to move the declaration of function, variables, or classes to the top of their scope, period, and execution of the code.


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

- When JS code runs it creates a global execution context and pushes it into the call stack and after the complete execution of the code it pops out from the call stack.
- If any WEB APIs come then it registers the timer web API or Browser after the timer is expired it pushes into the micro-task queue(high priority, Promises, async/await) or call-back queue (setTimeout, setInterval).
- Event loop watch the call stack if the call stack is empty then it pushes the task from the micro-task queue or call-back/task queue.

### Starvation:- 
It happens because in the micro-task queue if one executes and creates another call-back function it continuously happens and the micro-task is not free due to this higher priority, it runs again and again whenever the call stack is free and there is no chance of the call-back queue to run, due to this call-back queue going into starvation.
Meta tag demo
Published: 2024-05-15 19:10:10

> Meta tag list

```html
<meta name="description" content="Matchmaking For Muslim Healthcare Professionals">
    <meta name="keywords" content="Healthy Nika">
    <meta name="author" content="Healthy Nika">
    <meta name="theme-color" content="#cf085b">
    <meta property="og:title" content="Healthy Nika - Matchmaking For Muslim Healthcare Professionals">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://www.healthynikah.com/">
    <meta property="og:image" content="https://api.healthynikah.com/api/upload/images/share-img.png">
    <meta property="og:image:width" content="300">
    <meta property="og:image:height" content="300">
    <meta property="og:image:height" content="300">
    <meta property="og:locale" content="en_US">
    <meta property="og:site_name" content="Healthy Nika">
    <meta name="twitter:title" content="Healthy Nika - Matchmaking For Muslim Healthcare Professionals">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@">
    <meta name="msapplication-TileImage" content="https://api.healthynikah.com/api/upload/images/share-img.png">
```


---

> Full Index.html file

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Healthy Nika</title>
    <base href="/" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="icon" type="image/x-icon" href="favicon.ico" />
    <meta name="description" content="Matchmaking For Muslim Healthcare Professionals">
    <meta name="keywords" content="Healthy Nika">
    <meta name="author" content="Healthy Nika">
    <meta name="theme-color" content="#cf085b">
    <meta property="og:title" content="Healthy Nika - Matchmaking For Muslim Healthcare Professionals">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://www.healthynikah.com/">
    <meta property="og:image" content="https://api.healthynikah.com/api/upload/images/share-img.png">
    <meta property="og:image:width" content="300">
    <meta property="og:image:height" content="300">
    <meta property="og:image:height" content="300">
    <meta property="og:locale" content="en_US">
    <meta property="og:site_name" content="Healthy Nika">
    <meta name="twitter:title" content="Healthy Nika - Matchmaking For Muslim Healthcare Professionals">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@">
    <meta name="msapplication-TileImage" content="https://api.healthynikah.com/api/upload/images/share-img.png">
  </head>
  <body class="mat-typography">
    <app-root></app-root>
  </body>
</html>
```
Make stunning Landing Pages with ✨UIgraphic
Tags: ui, uidesign, webdev, design
Published: 2024-05-15 19:04:26

> This is not a paid article but the owner of the product contacted me and I found that he offers very good free and premium resources. So I think it might be interesting for who are looking for UI resources

![UIgraphic landing page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bz85ge4odrhooatb82i4.png)


## UIgraphic

If you don't know what is UIGraphic is a really simple platform that has 3D designs (free & premium) that can be used for real products in both plans. In addition when you download the design you got:

- PNG with the background
- PNG with the content
- PNG with the composition for desktop
- PNG with the composition for mobile/tablet
- Blender project to modify the whole the design

So if you just want the basic design you can use the PNG but if you want to go further you can change colors/position or add/remove elements in the Blender design to customize it for your product.

![Purchasing resources on UIgraphic](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fkw1vxzyjqcqp8xglp8b.png)

To download a resource is super easy you just need to give them your email and they will send you the zip with all the listed files.

![Files included in the zip](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pom2wg3541ls5h1yrb6n.png)

Now a days they offer **illustrations** (_free_ & premium), **animations** (premium) and they also offer custom products if you contact them

If you want to check out their website is [uigraphic.com](https://uigraphic.com).

Finally I will show you an example of a design resource, this is the one I have downloaded to test it out

![design example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ih58u7n27k0pbe45xgc1.png)
As you see is perfect for the top of a landing page.

Also good luck to the UIGraphic team because they seem to have launched very recently. ♥
Beginner here
Tags: lifestory, beginners, webdev, programming
Published: 2024-05-15 18:43:38

Hi, so I'm somewhat of a beginner here in HTML, CSS, and JavaScript. I want to know if anyone has any tips I could keep in mind for my journey. A little bit about my background is that I am pursuing a degree in computer science, but I think the classes are way too challenging for me, and I have failed a few. I really like to code, see the progress I have made, and prefer to go at my own pace, which is why a part of me wants to drop out. Overall, I'm Kinda feeling conflicted about my future; if anyone has any advice, please let me know. Thanks!
Beginner here
Tags: lifestory, beginners, webdev, programming
Published: 2024-05-15 18:43:37

Hi, so I'm somewhat of a beginner here in HTML, CSS, and JavaScript. I want to know if anyone has any tips I could keep in mind for my journey. A little bit about my background is that I am pursuing a degree in computer science, but I think the classes are way too challenging for me, and I have failed a few. I really like to code, see the progress I have made, and prefer to go at my own pace, which is why a part of me wants to drop out. Overall, I'm Kinda feeling conflicted about my future; if anyone has any advice, please let me know. Thanks!
@Controller vs. @RestController
Tags: java, spring, springboot, controller
Published: 2024-05-15 18:17:18


![Controller vs. RestController Annotation Cover Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmsei14f465qu7judpeg.png)
In the realm of Spring framework development, distinguishing between traditional Spring MVC controllers and RESTful web service controllers is pivotal, particularly in their approach to handling HTTP response bodies.

## Traditional Spring MVC Controller:
In the conventional Spring MVC paradigm, controllers rely on view technology, necessitating a distinct approach to managing HTTP response bodies compared to the more modern RESTful web service controllers.

## RESTful Web Service Controller:
Conversely, RESTful web service controllers are designed to return objects directly, with their data serialized into the HTTP response, typically formatted as JSON or XML. The introduction of the `@RestController` annotation in Spring 4.0 streamlined the creation of RESTful web services by combining the functionalities of `@Controller` and `@ResponseBody` annotations.

## Understanding Annotations:

### `@ResponseBody`
To grasp the distinction between `@Controller` and `@RestController`, it's crucial to comprehend the role of the `@ResponseBody` annotation. This annotation signifies that the return value of a method should be bound to the web response body, facilitating automatic serialization of the returned object into the HTTP response.

### `@Controller`
The `@Controller` annotation, a specialization of the `@Component` annotation, enables automatic detection of implementations through classpath scanning. When employing `@Controller`, it's imperative to include `@ResponseBody` in each `@RequestMapping` method to serialize the return value properly.

```java
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/v1/api")
public class GreetingController {

    @GetMapping("/greet")
    @ResponseBody
    public String greet() {
        return "Hello, World!";
    }
}
```

### `@RestController`
Introduced to simplify the development of RESTful web services, the `@RestController` annotation serves as a specialized form of `@Controller`. It eliminates the need for manually adding `@ResponseBody` to each `@RequestMapping` method, as it inherently combines the functionalities of both `@Controller` and `@ResponseBody`.

```java
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/api")
public class GreetingRestController {

    @GetMapping("/greet")
    public String greet() {
        return "Hello, World!";
    }
}
```

## Key Takeaways:
While both `@Controller` and `@RestController` can be used together, they cater to different needs – `@Controller` for rendering views and `@RestController` for returning domain objects as JSON or XML.

Original post appeared [here](https://bishalshrestha.substack.com/p/controller-vs-restcontroller).
The AWS Amplify Fullstack Typescript Challenge - Help Thread!
Tags: devchallenge, awschallenge, amplify, fullstack
Published: 2024-05-15 18:05:43

Looking for help with your Amplify DEV Challenge Submission? We're here to for you!

Feel free to post your questions or product feedback in the comments below, and we'll do our best to respond!

If you want to learn more about the challenge, you can read the announcement post here:

{% embed https://dev.to/devteam/join-us-for-the-the-aws-amplify-fullstack-typescript-challenge-3000-in-prizes-ghm %}
Deploying a web server on the Linux virtual machine
Tags: webserver, linux, azure, putty
Published: 2024-05-15 17:58:35

To deploy a web server on a Linux virtual machine, you will first need to ensure that your virtual machine is up and running and that you have access to it, either through a command line interface or a remote desktop connection — to learn how to create a virtual machine on Azure [Click Here](https://dev.to/raviknce0509/create-a-windows-virtual-machine-in-the-azure-portal-2l0g). 

here's a list of the five diverse use case examples for deploying a web server on a Linux virtual machine:

1. Hosting a Blog or Personal Website
2. E-commerce Platform
3. Corporate Intranet
4. Online Learning Platform
5. IoT Data Visualization

Once the Virtual machine is up and running you can follow these steps:

1. **Access the Linux virtual machine**:
Use tools like putty to establish a connection to your Linux virtual machine. You will need the IP address or hostname of the machine, as well as the login credentials.

![IP or Login cred](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8arvgwbo4s7gmha5d56w.png)

Once you click on Open, enter your login ID and password.

2. **Update package Index**:
Once logged in, it's a good practice to update the package index to ensure you have the latest information about the available packages. Run the following command.

```
sudo apt-get update
```

3. **Install Nginx Web Server**:
 Nginx is a popular web server that you can install using the following command:

```
sudo apt-get install nginx
```

4. **Manage Nginx Service**:
you can stop, start, or restart the Nginx service using the following commands:

```
sudo systemctl stop nginx     # Stop Nginx
sudo systemctl start nginx    # Start Nginx
sudo systemctl restart nginx  # Restart Nginx

```
5. **Verify Nginx Installation**:
You can verify that Nginx is running correctly by accessing your virtual machine's IP address or hostname in a web browser. If Nginx is installed and running properly, you should see the default Nginx welcome page.

![web page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wl04mdzvtq62c89gie53.png)

That's it! You should now have a functional Nginx web server deployed on your Linux virtual machine.
Hiab Crane/Truck Hire In Sydney
Published: 2024-05-15 16:52:24

Sydney Hiab Logistics is a trusted company offering crane truck hire services across Sydney. Specialising in Hiab crane trucks, the company ensures the safe and efficient transportation of heavy and oversized items. Whether you're in construction, need to move machinery, or transport large goods, [Sydney Hiab Logistics](https://sydneyhiablogistics.com.au) provides the right solution to meet your needs.

One of the standout features of Sydney Hiab Logistics is our fleet of advanced Hiab trucks. These vehicles are equipped with powerful cranes that can lift and move heavy loads with precision. This capability makes us ideal for various tasks, from delivering construction materials to placing heavy equipment in tight spaces. The company's modern equipment ensures reliability and safety in every job.

Customer satisfaction is a top priority for Sydney Hiab Logistics. Our team of experienced operators is trained to handle all types of lifting and transportation tasks. They work closely with clients to understand their specific requirements and provide tailored solutions. This personalised approach ensures that every project is completed efficiently and to the highest standard.

Safety is at the core of Sydney Hiab Logistics' operations. The company follows strict safety protocols and regularly maintains its equipment to ensure optimal performance. By adhering to industry standards and best practices, Sydney Hiab Logistics guarantees a safe working environment for both their staff and clients.

Sydney Hiab Logistics is a reliable choice for anyone needing crane truck hire services in Sydney. With a focus on advanced equipment, customer satisfaction, and safety, the company provides efficient and effective solutions for transporting heavy and oversized items. Whether for construction, industrial, or personal needs, Sydney Hiab Logistics stands out as a dependable partner in lifting and transportation.
Python und venv installieren - django in Produktion Teil 3
Published: 2024-05-15 17:38:50

## Vorwort
Im letzten Teil haben wir uns um das Aufsetzen der Datenbank gekümmert. Nun werden wir unsere Repository auf den Produktionsserver bringen. Ebenso kümmern wir uns um das Aufsetzen der Python-Pakete. 

## Python Installation
Um unseren Webserver zum laufen zu bringen brauchen wir die richtigen Python-Pakete & für die Datenbankverbindung libpq-dev und gcc. Diese können wir nun mit apt installieren.
```
sudo apt install git python3.11 python3.11-venv python3-dev libpq-dev gcc
```

## Repository aufsetzen
Als nächstes brauchen wir einen Ort, an dem unser Repository liegen wird. Dazu nutze Ich hier `/srv/www`
```
sudo mkdir -p /srv/www/
sudo cd /srv/www
sudo git clone git@github.com:mein_name/meine_repository.git
sudo cd meine_repository
```
PS: Falls du nicht vor alle Befehle ein `sudo` setzen willst, kannst du dich mit `sudo su -` zum root Nutzer machen. Aber dann vorsichtig sein ;)

## requirements.txt
Für dein Projekt brauchst du eine requirements.txt Datei. Falls du diese noch nicht mit deinen Python Paketversionen gefüllt hast, kannst du das jetzt machen.
In deinem Lokalen Repository ausführen:
```
pip freeze > requirements.txt
```
Zu deinem requirements.txt solltest du folgende Pakete hinzufügen:
```
# Webserver in Produktion
gunicorn

# postgresql database adapter
psycopg2
psycopg2-binary
```
Diese kannst du nun bei dir Lokal installieren:
```
pip install -r requirements.txt
```

## Venv installieren
Jetzt kannst du, wieder zurück auf deinem Produktiven Server alle Pakete im requirements.txt installieren. Dazu erstellen wir ein venv, damit du mehrere Python Umgebungen auf dem gleichen Server laufen lassen kannst.
Vorher solltest du am besten bei dir lokal das venv - Verzeichnis in dein .gitignore hinzufügen.
Bei dir Lokal:
```
echo "venv/" >> .gitignore
```
Auf dem Produktivserver:
```
# Mache dich zum root Nutzer & Gehe in dein Codeverzeichnis
sudo su -
cd /srv/www/meine_repository

# hole dir die Neuesten Updates aus deiner Repository
git pull

# Installiere deine Virtuelle Python-Umgebung
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt 
```

## PostgreSQL migrieren
Nun sollte der python manage.py migrate Befehl funktionieren! Aber halt, hast du deine Datenbank schon in deiner settings.py Datei hinzugefügt? Das schauen wir uns im nächsten Post an ;)

Viel Spaß beim Coden,
Dein Ruben

[Mein Blog](rubenvoss.de)