| Property | state Parameter |
PKCE (code_verifier) |
|---|---|---|
| Primary Threat | Login CSRF: An attacker tricks a victim into completing an OAuth flow using the attacker's authorization code. | Code Interception: An attacker steals a victim's authorization code and exchanges it for a token. |
| How It Protects | Binds the authorization callback to the user's specific browser session. | Proves that the entity exchanging the code is the same entity that requested it. |
| Validation Point | Checked by the Client Application Backend upon |
| Feature | Access Token | Refresh Token |
|---|---|---|
| Primary Purpose | Used to access protected APIs | Used to obtain new access tokens |
| Lifetime | Very short (15 minutes to 1 hour) | Long-lived (days, months, or until revoked) |
| Sent Where? | Sent with every API call to the Resource Server | Sent only to the Authorization Server's token endpoint |
| Storage Security | Can be kept in temporary server memory | Must be stored encrypted in secure storage |
| Architectural Property | GET | POST | QUERY |
|---|---|---|---|
| Request Body Allowed | No (Undefined Semantics) | Yes | Yes |
| Safe (Read-Only) | Yes | Potentially No | Yes |
| Idempotent (Safe to Retry) | Yes | Potentially No | Yes |
| Default Cacheable | Yes | No (Only future GET/HEAD) | Yes (Requires Body-Aware Keying) |
| Data Payload Location | URL Query String | Request Body | Request Body |
| Primary Use Case | Simple, short resource reads | Resour |
| 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 | |
NewerOlder