Do It by Code
54 subscribers
710 photos
99 videos
14 files
1.24K links
We uhhhhh... do things by coding them.
Download Telegram
Paid messages in chats

#Telegram
Paid messages in private chats

#Telegram
Withdraw stars from user’s balance

#Telegram
A Captive Portal & Access Point setup for use with the Raspberry Pi (no Internet access)

https://github.com/Splines/raspi-captive-portal
#python #CaptivePortal

A captive portal is a web page accessed with a web browser that is displayed to newly connected users of a Wi-Fi or wired network before they are granted broader access to network resources.
Do It by Code
Mozilla's New Terms of Use Are Out of Step with Firefox's Direct Competition Article, Comments
When you upload or input information through Firefox, you hereby grant us a nonexclusive, royalty-free, worldwide license to use that information to help you navigate, experience, and interact with online content as you indicate with your use of Firefox.
Do It by Code
New feature in Telegram Beta: Account info for unknown accounts Telegram will now show basic information about an account when they message you first, such as shown in the photo. #telegram
here is an example of the information telegram sends:

Code:

await app.get_chat_settings(user_id)


Result:
{
"_": "ChatSettings",
"can_report_spam": true,
"can_add_contact": true,
"can_block_contact": true,
"can_share_contact": false,
"can_report_geo": false,
"can_invite_members": false,
"is_autoarchived": true,
"is_business_bot_paused": false,
"is_business_bot_can_reply": false,
"need_contacts_exception": true,
"request_chat_broadcast": false,
"registration_date": "08.2022",
"phone_country": "KE",
"name_change_date": "2025-02-27 23:20:08"
}


The TL:
peerSettings#f47741f7 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true request_chat_broadcast:flags.10?true business_bot_paused:flags.11?true business_bot_can_reply:flags.12?true geo_distance:flags.6?int request_chat_title:flags.9?string request_chat_date:flags.9?int business_bot_id:flags.13?long business_bot_manage_url:flags.13?string charge_paid_message_stars:flags.14?long registration_month:flags.15?string phone_country:flags.16?string name_change_date:flags.17?int photo_change_date:flags.18?int = PeerSettings;
string literal concatenation
(also known as "string literal joining")

When you place two string literals next to each other with only whitespace between them, Python automatically concatenates them during the parsing phase.

So these are equivalent:
x = "hi" "hello"    # Results in "hihello"
x = "hi" + "hello" # Also results in "hihello"


This feature is particularly useful for breaking long strings across multiple lines:
long_string = "This is a very long string " \
"that I want to break " \
"across multiple lines"


As for other languages:
- C and C++ support this feature
- Java does not support this
- JavaScript does not support this
- Rust does not support this

It's worth noting that this only works with string literals (strings written directly in quotes in the code). It won't work with variables or expressions:
a = "hi"
b = "hello"
c = a b # This will cause a SyntaxError
c = a + b # This is the correct way


This feature is most commonly seen in C/C++ and Python, but it's relatively rare in modern programming languages.
Regex validator for JSON data

https://regex101.com/r/tA9pM8/1
React Flow

A customizable React component for building node-based editors and interactive diagrams

https://reactflow.dev/
https://reactflow.dev/examples
https://github.com/xyflow/xyflow

#react #flowchart