| Feature | @Value | @ConfigurationProperties |
|---|---|---|
| Best for | Single values | Grouped or structured properties |
| Type safety | Limited | Strong (binds directly to fields) |
| Supports validation | No | Yes |
| Preferred for large configs | ❌ | ✅ |
| Priority | Source | Example / Notes |
|---|---|---|
| 1 | Command-line arguments | e.g. --my.property=value when running the application |
| 2 | Java System properties | e.g. -Dmy.property=value |
| 3 | OS environment variables | e.g. export MY_PROPERTY=value |
| 4 | Application properties or YAML files | Located in src/main/resources/application.properties or .yml |
| 5 | Profile-specific configuration files | e.g. application-dev.properties when spring.profiles.active=dev |
| 6 | External configuration files | Files located in a /config directory outside the packaged JAR |
| 7 | JNDI attributes | Used in servlet containers or enterprise environments |
- Using this script, you can download all the videos from a YouTube Playlist in all supported resolutions (including 1080p and 2160p).
- Enter the playlist url and the resolution you wish to download.
- Install the required libraries: pytubefix, tqdm, tenacity
- Make sure you have
ffmpegsetup on your machine. Check the tutorial for the setup guide. - You can download the videos in the following resolutions: 144p, 240p, 360p, 480p, 720p, 1080p, 1440p, 2160p
- Check the video for available resolutions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import json | |
| from bs4 import BeautifulSoup | |
| from selenium import webdriver | |
| BROWSER = webdriver.Chrome(executable_path="chromedriver.exe") | |
| TOTAL_PERSONS = 100 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| def write_to_json(data: dict) -> None: | |
| data_list = [] | |
| for i in range(TOTAL_PERSONS): | |
| temp = { | |
| "Rank": data["ranks"][i], | |
| "Name": data["names"][i], | |
| "Link": f"https://www.bloomberg.com/billionaires/{data['links'][i]}", | |
| "Total net worth($)": data["worths"][i], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| def write_to_csv(data: dict) -> None: | |
| columns = ['Rank', 'Name', 'Link', | |
| 'Total net worth($)', '$ Last change', '$ YTD change', 'Country/Region', 'Industry'] | |
| with open(f"top-{TOTAL_PERSONS}-persons.csv", "w", newline="") as csv_file: | |
| writer = csv.DictWriter(csv_file, fieldnames=columns) | |
| writer.writeheader() | |
| for i in range(TOTAL_PERSONS): | |
| temp = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import json | |
| from bs4 import BeautifulSoup | |
| from selenium import webdriver | |
| BROWSER = webdriver.Chrome(executable_path="chromedriver.exe") | |
| TOTAL_PERSONS = 100 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| post_data = [1, 'Getting started with Rich', ('Ashutosh Krishna', 22, 'India')] | |
| # General Way, Don't Do ❌ | |
| post_id = post_data[0] | |
| post_title = post_data[1] | |
| author_data = post_data[2] | |
| author_name = author_data[0] | |
| author_age = author_data[1] | |
| author_country = author_data[2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const postData = [1, 'Getting Started With Rich', 'Ashutosh Krishna']; | |
| const [postId, postTitle, postAuthor] = postData; | |
| console.log(postId, postTitle, postAuthor); | |
| // With Objects | |
| const anotherPostData = { | |
| anotherPostId: 1, | |
| anotherPostTitle: 'Getting Started With Rich', | |
| anotherPostAuthor: 'Ashutosh Krishna' | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| post_data = [1, 'Getting started with Rich', 'Ashutosh Krishna'] | |
| post_id, post_title, post_author = post_data | |
| print(post_id, post_title, post_author) |
NewerOlder