teleren/devto huggingface dataset:
How to create a docker-compose.yml file for PostgreSQL and RabbitMQ
Published: 2023-02-19 09:23:55

Step 1: Install Docker and Docker Compose
Make sure you have Docker and Docker Compose installed on your machine. If you don't, you can download and install them from the Docker website.

Step 2: Create a new directory
Create a new directory for your project and navigate to it in your terminal.

```
$ mkdir myproject
$ cd myproject

```

Step 3: Create a new docker-compose.yml file
Create a new file called docker-compose.yml in your project directory.

```
$ touch docker-compose.yml

```
Step 4: Define services in the docker-compose.yml file
Add the following code to the docker-compose.yml file to define the services for PostgreSQL and RabbitMQ.

```
version: '3'

services:
  db:
    image: postgres
    restart: always
    environment:
      POSTGRES_USER: myuser
      POSTGRES_PASSWORD: mypassword
      POSTGRES_DB: mydatabase

  rabbitmq:
    image: rabbitmq
    restart: always
    ports:
      # AMQP protocol port
      - "5672:5672"
      # HTTP management UI
      - "15672:15672"
    environment:
      RABBITMQ_DEFAULT_USER: myuser
      RABBITMQ_DEFAULT_PASS: mypassword

```

In the above code, we define two services: db for PostgreSQL and rabbitmq for RabbitMQ. We use the official Docker images for both services, and we set some environment variables to configure them. You can change the values of these variables to suit your needs.

Step 5: Run the services with Docker Compose
Save the docker-compose.yml file and run the services with Docker Compose.

```
$ docker-compose up -d

```


The -d flag runs the services in the background. You should see output similar to the following:


```
Creating network "myproject_default" with the default driver
Creating myproject_db_1 ... done
Creating myproject_rabbitmq_1 ... done

```

Step 6: Verify the services
You can now verify that the services are running by checking the logs or connecting to them. For example, to connect to PostgreSQL:

```
$ docker exec -it myproject_db_1 psql -U myuser mydatabase

```
And to connect to RabbitMQ:

```
$ docker exec -it myproject_rabbitmq_1 rabbitmqctl list_users

```

That's it! You now have a docker-compose.yml file for PostgreSQL and RabbitMQ. You can add more services to the file as needed, and run them all with a single command using Docker Compose.
Colors & Fonts v4 is live
Tags: resources, webdev, design, productivity
Published: 2023-02-19 09:05:17

Greetings to all!
Colors & fonts V4 has been released, bringing with it hundreds of new options.
live at: 
- https://www.colorsandfonts.com/

The latest version offers a variety of new color systems, including popular ones from well-known brands such as:
✺ Uber
✺ Unwrapped
✺ GitHub
✺ Material UI
✺ IBM Design
✺ Tailwind CSS.

Additionally, the update includes:
✺ 100s of new curated color palettes
✺ 100s of new gradients
✺ Google font pairings
✺ Glyphs.

Figma files available at:
– figma.com/@MikeAndreuzza

Include:
You will find:
✺ Color Systems
- Unwrapped ━ Avbailable
- Untitled UI ━ Coming soon
- Primer web ━  Available
- Material ━ Coming soon
- Carbon ━ Coming soon
- Uber ━ Coming soon
- Tailwind ━ Coming soon

✺ Gradients
380 Available
If you have any question, feel free to ask or reach me at twitter.com/mike_andreuzza
Have a good day!
The Basics of the Document Object Model (DOM) and Its Available Methods
Tags: html, dom, javascript, webdev
Published: 2023-02-19 08:27:53

DOM stands for Document Object Model. It is a programming interface for web documents that provides a structured representation of the document as a tree-like structure, with each node representing a different part of the document. The DOM is essentially a programming interface that allows web developers to access and manipulate the content, structure, and style of web pages dynamically.

The DOM provides a way for web developers to write scripts that interact with the elements of an HTML or XML document.

The DOM tree is built from the HTML or XML document and consists of nodes such as elements, text, and attributes. Each node can have child nodes and parent nodes, forming a tree-like structure. Developers can use methods and properties provided by the DOM to access and manipulate these nodes.

## How to Access and Manipulate DOM Elements with Methods
The Document Object Model (DOM) provides a wide range of methods that allow web developers to access and manipulate the content, structure, and style of web pages dynamically. Here are some of the most commonly used DOM methods:

**getElementById():** This method returns a reference to the first DOM element with the specified ID. For example, you can use this method to select a specific element on a page and then manipulate its properties and attributes.

**getElementsByTagName():** This method returns an array of all DOM elements with the specified tag name. For example, you can use this method to select all the `<p>` elements on a page and then manipulate their properties and attributes.

**createElement():** This method creates a new DOM element with the specified tag name. You can then set its attributes and properties before adding it to the document using methods like `appendChild()` or `insertBefore()`.

**setAttribute():** This method sets the value of a specified attribute for a DOM element. For example, you can use this method to set the "src" attribute of an `<img>` tag to load a different image.

**getAttribute():** This method returns the value of a specified attribute for a DOM element. For example, you can use this method to get the value of the "href" attribute of a `<a>` tag.

**innerHTML:** This property allows you to access or change the HTML content of a DOM element. For example, you can use this property to replace the contents of a `<div>` element with new HTML content.

**removeChild():** This method removes a specified child node from a DOM element. For example, you can use this method to remove a specific `<li>` element from an unordered list.

These are just a few examples of the many methods available in the DOM API. By using these and other methods, web developers can create dynamic and interactive web pages that respond to user actions and update in real-time.
A Fun Programming Joke To Start Your Day
Tags: jokes, dailydeveloperjokes
Published: 2023-02-19 08:00:04

---
title: "A Fun Programming Joke To Start Your Day"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259a37a785.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
A new database query walks into a bar.

The server says "Sorry, cache only."
 -->
Array clone and dup method in Ruby.
Tags: ruby, rails, career, webdev
Published: 2023-02-19 07:38:43

## clone:

1. This method is a shallow copy of the object. Be aware that your attributes are unique.
2. Changing the attributes of the clone will also change the original.
3. create a new object with the same id, so all the changes made to that new object will overwrite the original record if hit .save.

```
 user = User.first
  User Load (0.2ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ?  [["LIMIT", 1]]
 => #<User:0x0000563e2b9b3268 id: 1, name: "Jane Doe", dob: nil, gender: nil, created_at: Tue, 14 Feb 2023 12:45:36.528000000 UTC +00:00, updated_at: Tue, 14 Feb 2023 12:45:36.528000000 UTC +00:00>

 new_user = user.clone
 => #<User:0x0000563e2bb8a0f0 id: 1, name: "Jane Doe", dob: nil, gender: nil, created_at: Tue, 14 Feb 2023 12:45:36.528000000 UTC +00:00, updated_at: Tue, 14 Feb 2023 12:45:36.528000000 UTC +00:00>
```


## dup:

1. Duped objects have no ID assigned and are treated as new records.
2. This is a “shallow” copy as it copies the object’s attributes.
3. create a new object without its ID being set, so you can save a new object to the database by hitting. save.

```
user = User.last
User Load (0.1ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT ?  [["LIMIT", 1]]
=> #<User:0x0000563e2b9b1008 id: 3, name: "bhartee", dob: nil, gender: nil, created_at: Tue, 14 Feb 2023 12:45:57.223000000 UTC +00:00, updated_at: Tue, 14 Feb 2023 12:45:57.223000000 UTC +00:00>

new_user = user.dup
=> #<User:0x0000563e2c18a180 id: nil, name: "bhartee", dob: nil, gender: nil, created_at: nil, updated_at: nil>
```
Difference:

> clone copies of the singleton class, while dup does not.
```
o = Object.new
=> #<Object:0x0000563e2c319a78>

> def o.foo
>   42
> end

=> :foo

> o.dup.foo
(irb):31:in `<main>': undefined method `foo' for #<Object:0x0000563e2bbd2508> (NoMethodError)

> o.clone.foo
=> 42
```

> 
clone preserves the frozen state, while dup does not.

```
class Foo
  attr_accessor :bar
end
o = Foo.new
o.freeze

o.dup.bar = 10
=> 10

o.clone.bar = 10
(irb):39:in `<main>': can't modify frozen Foo: #<Foo:0x0000563e2b9e8e18> (FrozenError)
```
How to Start and Stop the PostgreSQL Database
Tags: postgres, database, aws, azure
Published: 2023-02-19 07:37:40


AWS

In Amazon RDS for PostgreSQL, you can control the state of your database instance (start or stop) using the AWS Management Console, AWS CLI, or AWS API. The following are the two modes for starting and stopping a PostgreSQL database instance:

    “Start” mode: This mode starts the database instance and makes it available for use. In this mode, you can connect to the database and perform read and write operations. To start a database instance using the AWS Management Console, you can select the instance and click the “Start” button. You can also start a database instance using the AWS CLI with the following command:

Read more: 
https://thedbadmin.com/how-to-start-and-stop-the-postgresql-database/
Polaris bank code 2023
Published: 2023-02-19 07:36:42

[https://www.bankfanz.com/polaris-bank-transfer-code/](https://www.bankfanz.com/polaris-bank-transfer-code/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)

https://plaza.rakuten.co.jp/polarisbankcode1/diary/202302160000/
https://peatix.com/user/16024996/
https://www.provenexpert.com/polaris-bank-code-to-check-balance-20236/
https://www.producthunt.com/@polarisbank009
https://www.divephotoguide.com/user/polarisbankcode9
https://wakelet.com/@Polarisbankcodetocheckbalance45
https://vocal.media/authors/polaris-bank-code-to-check-balance-febei80cg3
https://www.lifeofpix.com/photographers/polarisbank9/
https://seedandspark.com/user/polaris-bank-code-to-check-balance-7
https://rosalind.info/users/Polarisbankcode9/
http://phillipsservices.net/UserProfile/tabid/43/userId/200764/Default.aspx
https://app.roll20.net/users/11646365/polaris-bank-code-to-check-balance-2
https://speakerdeck.com/polarisbankcode9
https://social.msdn.microsoft.com/Profile/Polaris%20bank%20code%20to%20check%20balance%209
https://camp-fire.jp/profile/polarisbank9
https://plazapublica.cdmx.gob.mx/profiles/Polarisbankcode9/activity
https://www.metal-archives.com/users/polarisbankcode9
https://storium.com/user/polarisbankcode9
https://trabajo.merca20.com/author/polarisbankcode9/
https://www.intensedebate.com/people/Polarisbank9
https://www.mifare.net/support/forum/users/polarisbank9/
https://pinshape.com/users/2577608-polaris009
http://foxsheets.com/UserProfile/tabid/57/userId/121473/Default.aspx
https://www.kompasiana.com/polarisbankcode9
https://www.credly.com/users/davis-maison/badges
https://www.myminifactory.com/users/polarisbankcode9
https://www.sqlservercentral.com/forums/user/polarisbankcode9
https://www.longisland.com/profile/polarisbankcode9
https://guides.co/a/davis-maison
https://myanimelist.net/profile/Polarisbankcode9
How to simplify importing multiple components in another component ?
Tags: react, javascript, webdev, beginners
Published: 2023-02-19 07:30:53

Suppose we have multiple components namely Component1, Component2 and Component3. Importing them in the main Component (usually the App Component) will look like this.

`import Component1 from './path-to-component1'`
`import Component2 from './path-to-component2'`
`import Component3 from './path-to-component3'`

This is repetitive. This can be solved by creating a new js file inside the components directory & exporting the components inside it.

`export { default as Component1 } from './path-to-component1'`
`export { default as Component2 } from './path-to-component2'`
`export { default as Component3 } from './path-to-component3'`

Now inside the main Component (usually the App Component) we can import them using the below one-liner.

`import { Component1, Component2, Component3 } from './path-of-the-js-file-containing-export-statements'`
Enter into your folders which has space and command prompt or power shell gives error
Tags: powershell, commandprompt
Published: 2023-02-19 07:14:28

I have a file here and I want to run it using the command prompt:

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

Lets go to the E drive where we had our file and check out the desired folder from power shell.

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



Now you can not enter the folder as the powershell assumes these 2 different folders

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

To solve this, go to your folders location:

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

Then remove the location in the top bar:

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

Just press it and delete all.

Then write "powershell"

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




You will be prompted to this window now:

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

We have solved such a big issue! 😵‍💫
<img src="https://media.giphy.com/media/26ufdipQqU2lhNA4g/giphy.gif">
MobaXterm - An excellent tool for Linux CLI users to work on a Windows host
Tags: crossplatform, mobaxterm, windows, cli
Published: 2023-02-19 06:55:04

I have been working with Linux for a long time using the command-line interface (CLI). Recently, I started using a Windows 11 laptop as my main working machine. To my delight, I discovered MobaXterm, an excellent tool that provides a Unix-like working environment. With MobaXterm, I can interact with my Windows 11 laptop as if it were a Linux machine. For example, I can use apt-get to install applications such as nano, write and execute shell scripts, and perform a variety of other tasks that were previously only possible on Linux systems.
**References:**
[1]https://mobaxterm.mobatek.net/documentation.html
[2]https://www.admin-magazine.com/Articles/MobaXterm-Unix-for-Windows
Quick report after one week in boot camp
Tags: beginners
Published: 2023-02-19 06:45:23

I've finished my first week of boot camp.

So far, so good! It's a part-time program, so I'm able to do my normal job, but I've found that the practice I've done beforehand with other online resources has helped tremendously.

The real challenge will be when we start other languages such as Javascript and React, but for now, things are going well!
Giới Thiệu Về SODO66 Nhà Cái Đẳng Cấp Châu Á
Published: 2023-02-19 06:43:03

Giới Thiệu Về SODO66 Nhà Cái Đẳng Cấp Châu Á
Trò chơi cá cược xổ số online vô cùng hấp dẫn
Trò chơi cá cược xổ số online vô cùng hấp dẫn
Game bài cá cược online top 1 Châu Á hiện nay.
Những thông tin tại nhà cái SODO66 luôn chính xác
Thông tin liên hệ SODO66
Website: https://www.trafiktedikkat10binhayat.com/gioi-thieu-sodo66/
Địa chỉ: 90A Hồ Văn Huê, Phường 9, Phú Nhuận, Thành phố Hồ Chí Minh, Việt Nam
Email: trafiktedikkat10binhayat.sodo66@gmail.com
Điện thoại: +84563554173
#trafiktedikkat10binhayat #sodo66, #sodo66_site, #nha_cai_sodo66, #nhacaisodo
Database Indexes
Tags: database, architecture, beginners, indexes
Published: 2023-02-19 06:20:05

The indexes in a database are a data structure that acts like a table of contents to point us toward the data location. It improves data retrieval speed since we can locate the data easily without looking at every row in the database table. However, for speedy data retrieval, the use of indexes compromises with increased storage and slower write operations. The latter includes writing the data and updating the index subsequently.

The indexes can have multiple columns of the database table where there are ordered records for efficient search. These columns have a pointer to the whole row of the index. Further, we can use indexes for giving different views of the same data. For example, if you have a larger dataset, the data can be sorted easily without making multiple copies of them.

An index can either be dense or sparse — depending on its qualities.

## Dense Index

The index is dense if the record is created for every row present in the table. Each record has searched key value and a pointer to the data which means the maintenance work at write-time is increased with a dense index when compared to a sparse index. The database should help it with inserts, updates, and deletes since every row needs an entry. This uses more memory but balances it with letting the search easy with binary search. In addition, the data don’t have extra requirements tasks in the dense index.

## Sparse Index

Moving on, the sparse index works on selected records only. It requires less maintenance since it is just a little subset of all the rows. It consequently speeds up the inserts, updates, and deletes while the memory used is comparatively less. The worse thing about the sparse index is that it slows down the data retrieval process by scanning the page first and following it with the binary search. If you have ordered data, the sparse index can be an option as well.

## Conclusion

Database Indexes are a good way to better data retrieval options and can be used for your large sets of databases as well. With the two columns with the primary key in the first and the pointer in another, the data records search becomes easy and efficient.

{% embed https://github.com/pragyaasapkota/System-Design-Concepts %}

**_I hope this article was helpful to you._**

**_Please don’t forget to follow me!!!_**

**_Any kind of feedback or comment is welcome!!!_**

**_Thank you for your time and support!!!!_**

**_Keep Reading!! Keep Learning!!!_**
Difference between yield and await in Dart / Flutter
Tags: dart, flutter, beginners, programming
Published: 2023-02-19 05:41:01

In summary:
`yeild` is used under the context of a Business Logic Component or *BLoC* and `await` is used under the context of a *Future*.

The yield keyword is used in a Dart generator function to return a value from the function and pause the function's execution until the next value is requested. In a Bloc, the yield keyword is used to emit a new state from the mapEventToState function in response to an event.

mapEventToState is a method in a Bloc class that maps an incoming event to a new state. It takes an event as an input and returns a state as an output. In a Bloc, the mapEventToState method is responsible for converting incoming events into new states, which can be emitted using the yield keyword. For example, in the code mapEventToState(event), the mapEventToState method is called with the event object as an argument, and it returns a new state based on the type of the event. The new state can then be emitted using the yield keyword, and it will be passed to the BlocBuilder widget to update the UI.

If you have any questions, you know where to find me.

Get good. Be good. Code hard! Cheers!
Jenkins Slack integration : How to Send Notification Jenkins to Slack,Test Report or Custom Messages
Tags: webdev, beginners, programming, tutorial
Published: 2023-02-19 05:31:56

In this video, we are going to learn about the jenkins slack integration. We will use the Slack Notification Jenkins Plugin.

{% embed https://youtu.be/vQi6jKkX5OM %}

This is LIVE DEMO where we will be running our Selenium Maven Java(git) Project with Jenkins Email configurated.


🟣🟣 How to send Slack Notification from Jenkins Job?
Install Instructions for Slack
Get a Slack account: https://slack.com/


Configure the Jenkins integration: https://my.slack.com/services/new/jen...


Install this plugin on your Jenkins server:

From the Jenkins homepage navigate to Manage Jenkins
Navigate to Manage Plugins,
Change the tab to Available,
Search for slack,
Check the box next to install.

Test Message


🟣🟣 LINK To Slide
http://sdet.live/notes


🟣🟣 LINK To the Project
http://sdet.live/notes


🟣🟣 Link to Jenkins Send Email configuration
https://stackoverflow.com/questions/1...


#slacknotificationjenkins #jenkinsslack #jenkinstutorial #jenkinsslackintegration 

🟢 30 Days of Automation Testing
https://go.scrolltest.com/automation


🟢 30 Days of API Testing
https://apitesting.co/30days


🟢 30 Days of Rest Assured
https://go.scrolltest.com/30days-rest...


🟣🟣 Download Slides and Notes - http://sdet.live/notes

🟣🟣 My Resume Template - http://sdet.live/notes


✅ API Testing –
https://www.learnapitesting.com


✅ Cypress Tutorial with LIVE Projects –
http://cypresstutorial.com


🔗 Join the Facebook Group - http://scrolltest.com/fb

🔗 Learn API Testing(with Postman) - https://learnapitesting.com/

🔗 Rest API Testing with Python - http://masterapitesting.com/

🔗 E2E Frontend Testing with Cypress - http://cypresstutorial.com/

🔗 Join Our Automation Newsletter - http://scrolltest.com/tta

🔗 Master API Testing Bundle - https://apitesting.co/bundle

🔗 Rest Assured MasterClass- https://apitesting.co/enroll