teleren/devto huggingface dataset:
How to link Unsplash Images in Html and CSS
Tags: html, css, unsplash, webdev
Published: 2023-03-05 18:04:47

If you are reading this blog, I assumed you already know what Unsplash is and if you don't know. Unsplash is a website for free stock photography images. Unsplash lets you download images directly to your computer or link images to your blog.

In this blog post, you will learn how to link images from Unsplash to your HTML or CSS stylesheet.

# Linking Unsplash Image to HTML tags.

Once your HTML tag has been created, paste the image `url` to the `src` attribute in your HTML code.

Unspash requires a `source` keyword before the `unsplash.com`

*Example 1*

```xml
<main class="image__wrapper">
  <img src="https://source.unsplash.com/" alt="" width="300" >
</main>
```

Then go to Unsplash and select any image of your choice.

* Click on the image you want to link to your project
    
* Copy the image *id* from the address bar on your browser and paste it after the forward-slash as indicated below.
    
![How to link Image from Unsplash](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59ubwu7gt38ukzptwg0g.png)

*Example 2*

```xml
<main class="image__wrapper">
  <img src="https://source.unsplash.com/3tYZjGSBwbk" alt="" width="300" >
</main>
```

Browser Preview


![How to link Unspash images to your HTML file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zy28xzp6eodzjnytgrpz.png)

# Linking Unsplash image to CSS rule

The process remains the same. After you must have created your CSS rule, add the image to the `background` or `background-image` property as how below.

*Example 3*

```xml
 <main class="image__wrapper">
        <img src="" alt="" width="" >
  </main>
```

```css
main {
    background:url('https://source.unsplash.com/3tYZjGSBwbk');
    width: 300px;
    height: 400px;
    background-position: center;
    background-repeat: no-repeat;
    background-origin: content-box;
    background-size: cover;
}
```

![How to link Image from Unsplash](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/796defjode8xpirdfu3d.png)

When you choose to use CSS to link your image, don't use the `img` tag or any other empty tags, as this will not work. this is because the `img` tag or empty tags are self-contained element and does not have a background.

### Dont Use the Img tags to select images on CSS


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

### Use a NON-Empty tag instead


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

# Wrapping up

We learned about *How to link Unsplash Images in Html and CSS* and we discussed.

* Linking Unsplash Image to HTML tags.
    
* Linking Unsplash image to CSS rule
    

Alright! We’ve come to the end of this tutorial. Thanks for taking the time to read this article to completion. Feel free to ask questions. I’ll gladly reply. You can find me on Twitter and other social media @ocxigin. or email me at ocxigin@gmail.com

_Cheers_
What is Apache Age?
Published: 2023-03-05 18:01:59

**What is Apache Age?**

Apache Age is a PostgreSQL extension that allows users to use graph database features in PostgreSQL. It provides an efficient way to store and query graph data using SQL.

**How to use Apache Age with PostgreSQL
**
To use Apache Age with PostgreSQL, you need to first install the extension. You can do this by following the instructions provided on the Apache Age GitHub page.

Once you have installed the extension, you can start using Apache Age to store and query graph data in PostgreSQL.

**Key Features of Apache Age**

Some of the key features of Apache Age include:

Graph data modeling: Apache Age allows you to model your data as a graph, with nodes and edges. You can create tables for nodes and edges, and use SQL to add, update, and delete nodes and edges.
Graph query language: Apache Age provides a powerful graph query language called GSQL. GSQL allows you to query your graph data using graph traversal algorithms, and to return results in a tabular format.
Graph visualization: Apache Age comes with a built-in graph visualization tool called GAdmin. GAdmin allows you to visualize your graph data and to explore the relationships between nodes and edges.
**Conclusion**

Overall, Apache Age is a powerful tool that extends the functionality of PostgreSQL to support graph data modeling and query. If you have graph data that you need to store and query, Apache Age can be a great option to consider.



[Apache-Age:-https://age.apache.org/](https://age.apache.org/)
[GitHub:-https://github.com/apache/age](https://github.com/apache/age)
Release 0.9.0 of stevedore - minor feature enhancement
Tags: docker, stevedore, cli, ignore
Published: 2023-03-05 17:45:26

---
title: Release 0.9.0 of stevedore - minor feature enhancement 
published: true
description: introducing use of a local, repository based configuration file
tags: docker, stevedore, cli, ignore
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-03-05 17:27 +0000
---
I have just finalized and release [version 0.9.0](https://github.com/jonasbn/stevedore/releases/tag/v0.9.0) of [my stevedore command line tool](https://github.com/jonasbn/stevedore), to assist in handling Docker ignore files.

The most recent feature addition is the detection and use of a repository based configuration file.

The file should be named: `.stevedore.json` and should reside in the root of the project/repository. The file can contain presets for most of the common command line arguments, so these will not have to be entered upon every invocation.

Example:

```json
{
    "$schema": "stevedore-config.schema.json",
    "color": true,
    "debug": false,
    "excluded": false,
    "fullpath": true,
    "ignorefile": ".stevedoreignore",
    "included": false,
    "invertcolor": false,
    "verbose": false
}
```

For example you could set the `invertcolor` to `true` and the red and green coloring would be inverted, if that was your preferences. Do note you only have to specify the parameters, which you do not want to type upon every invocation and that differs from the default.

It took some time to get the precedence of the command line flags over the configuration to work. But luckily the Go flag package, has a method: `visit` ([documentation](https://pkg.go.dev/flag#Visit)), which allows for easy post-processing of all used flags.

I am not sure I will keep the configuration file in JSON format, since it is much more suitable for data, so I am evaluating YAML - but with schema handling, since that is what I am aiming for and why I chose JSON over YAML in the first place. There seem to be options to use schemas for YAML as well, but I will need to do some more research before making a decision - any pointers or suggestions would be most welcome.

Next up on the implementation plan, is a global configuration file, see issue [#28](https://github.com/jonasbn/stevedore/issues/28).

Feedback and suggestions most welcome. Releases should be [available for download for most platforms](https://github.com/jonasbn/stevedore/releases/tag/v0.9.0).

Or you can install using Go:

```shell
go install github.com/jonasbn/stevedore@v0.9.0
```
Drifts again
Tags: spacelift, aws, configuration, tutorial
Published: 2023-03-05 17:45:00

---
title: Drifts again
series: spacelift
published: true
description: Use of workers pool to run a drift detection
tags: #spacelift #aws #configuration #tutorial
cover_image: https://www.pawelpiwosz.net/assets/covers/spacelift-cover.png
---

In the previous episodes we learned what is drift and how to detect it. We also learned how to configure the workers pools and use them to run our workloads. Finally, we know that drift detection can be run on workers pool only. So, let's put this knowledge together, and schedule the detection.

# Change the behavior

First, we need to change the behavior for the whole stack. Navigate to `Behavior` tab and switch the `Worker pool` from default to newly created one.

![Change workers pool](https://www.pawelpiwosz.net/assets/spacelift-intro/spacelift-intro-27.jpg)

# Create the schedule

We have to repeat the steps we already try to done once.

Navigate to `Settings` then `Scheduling` and create new schedule for drift detection.

![Create schedule](https://www.pawelpiwosz.net/assets/spacelift-intro/spacelift-intro-28.jpg)

As we can see, there is no need to set the workers pool, it is already done on the stack level.

When done, we should see confirmation and details of scheduled task.

![Created schedule](https://www.pawelpiwosz.net/assets/spacelift-intro/spacelift-intro-29.jpg)

# Drift detected!

After the check is done, we can see the visualised report about the drift. We can look on this report from a few places, but we do it now from Stack's `Resources` tab.

![Drift reported](https://www.pawelpiwosz.net/assets/spacelift-intro/spacelift-intro-30.jpg)

The drifted resources are marked with sign on it.

# Reconcile

The configuration we did is to detect drift only. I mentioned briefly, that we can also act on it. When we setup the drift detection, we can switch `Reconcile` on. In this case, when drift will be detected, the corresponding stack will be triggered to fix it.

# Summary

Clearing drifts in automatic way should be the goal of every team when use IaC. Spacelift is doing it well.

I think though, there are some points for improvements

* `Reload` button. Even if the page is reloading periodically, I wish to have this option.
* More details about drifted resources. Something like `should be vs it is` comparision for drifted resources.

# Takeaways

We learned how to create drift detection and how to act on it. We also know how to check and visualise drifts.
Understanding how DOM tree constructed
Published: 2023-03-05 17:28:30

The Document Object Model (DOM) is a hierarchical tree structure that represents the elements, attributes, and text content of an HTML or XML document. The DOM is essential for creating dynamic web pages and web applications that can interact with user input and respond to changes in real-time.

In this blog, we will dive into the process of how the DOM gets constructed and explore some examples of how to work with the DOM to manipulate web pages.

## DOM Construction Process:

The process of constructing the DOM starts when the browser receives an HTML or XML document from a server. The browser then parses the document and creates a tree-like structure, with each element represented as a node in the tree.

The following are the steps involved in constructing the DOM:

1. Parsing: The browser starts by parsing the HTML or XML document and breaking it down into a series of tokens.

2. Tokenizing: The tokens are then organized into a tree-like structure based on their relationships to each other, forming the DOM tree.

3. Building the tree: The DOM tree is constructed by creating nodes for each element in the document. Each node represents an HTML or XML element, including its attributes and content.

4. Parent-child relationship: The nodes are then arranged in a parent-child relationship, with each node's parent being the node that contains it. 

5. Finalizing: The DOM construction process ends when the entire document has been parsed, tokenized, and organized into a tree-like structure.

Let's look at an example to better understand how the DOM construction process works:


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

When the browser receives this HTML document, it starts by parsing it into a series of tokens. The tokens are then organized into a tree-like structure based on their 

relationships to each other, forming the DOM tree:


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

In this example, the root node of the DOM tree is the html element, with head and body elements as its children. The head element contains a title element as its child, and the body element contains an h1, p, and ul element as its children. The ul element contains three li elements as its children.

Once the DOM tree is constructed, it can be accessed and manipulated using JavaScript. This allows developers to add, remove, or modify elements and their attributes and content dynamically in response to user actions or other events.

## Conclusion:

The Document Object Model (DOM) is a hierarchical tree structure that represents the elements, attributes, and text content of an HTML or XML document. The DOM construction process starts with parsing the document and creating a tree-like structure, with each element represented as a node in the tree. Understanding how the DOM gets constructed is essential for creating dynamic web pages and
How to Create a Simple Counter Application with React Hooks
Tags: javascript, react, beginners, tutorial
Published: 2023-03-05 17:06:07

{% youtube BXZRM6dVb_o  %}

---

The `useState` hook in React is a powerful feature that allows developers to manage state within functional components. In this challenge, we use the useState hook to create a simple counter application that increments or decrements the count when a user clicks a button.

To get started, we import React and the `useState` hook, and define a functional component called `Counter`. Inside the Counter component, we initialize a state variable called `count` to 0 using the useState hook, and define two functions called `handleIncrement` and `handleDecrement` that respectively increment and decrement the count state variable when called.

In the return statement, we display the current `count` value using an h1 tag, and provide two buttons that call the `handleIncrement` and `handleDecrement` functions when clicked. This allows the user to increment or decrement the `count` by clicking the respective buttons. To view the code for this counter application, check out my [GitHub](https://github.com/SidraMaq/ReactJs/tree/main/counter-app) repository.

Overall, the `useState` hook in React is a powerful tool for managing state in functional components. By using the `useState` hook to create a simple counter application, we can see how easy it is to manage state and handle user input in React. This challenge is a great starting point for anyone who is new to React or just getting started with hooks. With a solid understanding of the `useState` hook, you can build more complex applications with ease. So give it a try and see what you can create!
how to use Python virtual environments with conda - some notes
Tags: webdev, python, vscode, conda
Published: 2023-03-05 16:52:05

how to use Python virtual environments with conda, you can follow these steps:

Open your terminal or Anaconda prompt.

Create a new conda environment by typing the following command:

```conda create --name env_name python=X.X```

Replace env_name with the name you want to give to your environment and X.X with the version of Python you want to use. For example, to create an environment called my_env with Python 3.9, you would type:

```conda create --name my_env python=3.9```

Activate the environment by typing:

```conda activate env_name```

Replace env_name with the name of your environment. For example, to activate the my_env environment, you would type:

```conda activate my_env```

Install any packages you need for your project using conda install. For example, to install the pandas package, you would type:

```conda install pandas```

When you're finished working in the environment, you can deactivate it by typing:

```conda deactivate```

This will return you to your default system Python installation.

To delete the environment, you can use the following command:


```conda env remove --name env_name```

Replace env_name with the name of the environment you want to delete. For example, to delete the my_env environment, you would type:

```conda env remove --name my_env```

That's it! Using conda with Python virtual environments is a great way to keep your project dependencies organized and isolated.
How to Fix WebSocket Connection Error in Nginx and React on Docker
Tags: docker, react, nginx, socketio
Published: 2023-03-05 16:20:56

If you're running an application on Docker that uses Nginx as a reverse proxy server and React as a front-end framework, you might have encountered the following error message when trying to access the React app from the browser:

```
WebSocketClient.js:16 WebSocket connection to 'ws://localhost:3000/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
```

This error occurs because the web app is trying to access `ws://localhost:3000/ws`, which does not exist, and Nginx is running on a different port. 

To fix this error, you need to change the Nginx port to `3000`, which is the same port as the React app running inside the Docker container. 


You also need to add the location `/ws` into the Nginx configuration file and route it to the React client running in the Docker container.

Here are the steps to fix the error:

1. Open the docker compose file and change the port mapping of the nginx to `3000` or change the script for running the nginx image to 
`docker run -p 3000:80 <IMAGE ID / IMAGE NAME>`

2. Open the Nginx configuration file `nginx.conf` and add the following lines inside it. ```
location /ws {
  proxy_pass http://localhost:3000;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
}
``` The `location` block defines the URL path that should be routed to the React app running on port `3000`. The `proxy_pass` directive sets the URL to which the request should be forwarded, and the `proxy_http_version` and `proxy_set_header` directives configure the connection between Nginx and the React app.

3. Save the configuration file, build the docker image and run the image again

4. Now, when you try to access the React app from the browser, the error should be fixed, and the WebSocket connection should work correctly.

Note that this solution applies when the container is running locally, and it might not be necessary when running in production, such as when deploying to AWS Elastic Beanstalk.

In conclusion, the WebSocket connection error in Nginx and React on Docker can be solved by changing the Nginx port to `3000`, adding the `location /ws` to the Nginx configuration file, and routing it to the React client running in the Docker container.


If you have any questions or concerns about this solution, please don't hesitate to leave a comment below. We'd be happy to help clarify any issues you may have. Also, if you found this post helpful, please consider giving it a like or sharing it with others who may be facing a similar issue. Thanks for reading!
How to Active Windows 10 For Free [2023]
Published: 2023-03-05 16:13:40

As I mentioned earlier, it is recommended to purchase a genuine product key to activate Windows 10. By doing so, you are not only complying with Microsoft’s license agreement and terms of use, but you also get access to all the features and updates that come with a genuine copy of Windows 10. However, if you are unable to purchase a product key or if you want to try activating Windows 10 without one, the methods I discussed earlier can be helpful.
How to Active Windows 10 With Product Key ?

Let’s take a closer look at each method and how to implement them:

1. Use the built-in activation troubleshooter:

The built-in activation troubleshooter in Windows 10 is a useful tool that can help you activate your copy of Windows without a product key. To access it, go to Start > Settings > Update & Security > Activation. Click on the “Troubleshoot” button under “Activate Windows” and follow the instructions.

The troubleshooter will check for any issues with your system and will attempt to fix them automatically. If it is unable to do so, it will provide you with some options to resolve the issue manually. One of these options may be to enter a product key, but you can choose to skip this step and continue with the troubleshooter.

If the troubleshooter is successful in activating your copy of Windows 10, you will receive a confirmation message. However, if it is unable to activate Windows, you may need to try one of the other methods I mentioned earlier.

2. Use a generic product key:

A generic product key is a code that can be used to activate Windows temporarily. This method is useful if you need to use Windows for a short period of time, such as to test a software application or to complete a project. To use a generic product key, follow these steps:

Open the Command Prompt as an administrator.
Type in the following command: “slmgr /ipk <generic product key>”. Replace <generic product key> with one of the following product keys depending on your edition of Windows 10:
Windows 10 Home: YTMG3-N6DKC-DKB77-7M9GH-8HVX7
Windows 10 Pro: VK7JG-NPHTM-C97JM-9MPGT-3V66T
Press Enter and wait for the confirmation message.
Note that using a generic product key will only activate Windows temporarily, and you will need to purchase a genuine product key to continue using Windows after the temporary period is over.

If You want to try to another best method [Click Here.](https://techzpad.com/active-windows-10-for-free)
We are all typing monkeys
Tags: speedtyping, monkey
Published: 2023-03-05 15:59:26

I want to give a shout-out to a great website called https://monkeytype.com!

For the past few weeks, I've been using this website to train my typing speed, and I'm proud to say that I've increased my WPM count from 60 to 90. My goal is to surpass 100 WPM within the next month.

Not only did it make me more efficient at work, but it also gave me a boost of confidence knowing that I had developed a valuable skill. And the best part? Practicing typing is a fun activity that only takes a couple of minutes a day, and you can see results pretty quickly.

I recommend that everyone who uses a computer daily should work on improving their typing speed (until we could control it with our minds). It may seem like a small thing, but it can make a big difference in your productivity and overall computer experience.

So why not give it a try and see how much you can improve? 😁
Landing my next frontend engineering career
Tags: career, frontend, webdev, programming
Published: 2023-03-05 15:51:03

Dear everyone,

I hope this message finds you well. As a leading figure in the tech industry, I understand how important it is to have a strong and talented development team. That's why I'm reaching out to you today with a proposition that I believe could be of interest to you.

My name is Jin Narihira, and I am a Senior Frontend Developer specialized in React.js and Next.js. I have several years of experience working in this field, and I have been fortunate enough to have contributed to the development of some of the most cutting-edge applications and websites.

I am currently seeking new opportunities, and I believe that your organization could be the perfect fit for me.

As a Senior Frontend Developer, I am confident that I could make a valuable contribution to your team. My expertise in React.js and Next.js is unparalleled, and I have a track record of delivering high-quality work that exceeds expectations.

I would love the opportunity to discuss this further with you and to learn more about your organization and your goals. If you're interested in learning more about me and my experience, please don't hesitate to get in touch.

If you want to know more about me, please visit here.

Thank you for your time, and I look forward to hearing from you soon.

Best regards,
Jin Narihira