Dev communicates
2 subscribers
7 photos
3 files
20 links
Download Telegram
#mui #media_query #responsive

Using `@mui/system`'s `styled` Component:

import { styled } from '@mui/system';

const MyComponent = styled('div')(({ theme }) => ({
width: '100%',
[theme.breakpoints.up('md')]: {
width: '50%',
},
}));


Employing `theme.breakpoints`:

import { useTheme } from '@mui/material/styles';

function MyComponent() {
const theme = useTheme();

const styles = {
container: {
width: '100%',
[theme.breakpoints.up('md')]: {
width: '50%',
},
},
};

return <div style={styles.container}>...</div>;
}


Leveraging `useMediaQuery` Hook:

import { useMediaQuery } from '@mui/material';

function MyComponent() {
const matches = useMediaQuery('(min-width:600px)');

return <div>{matches ? 'Large screen' : 'Small screen'}</div>;
}
Forwarded from Yasin Gorgij
Let's Go Further - 2021.pdf
7.7 MB
Forwarded from Yasin Gorgij
lets-go-web-applications.zip
19.1 MB
Let's Go (2nd Edition)
1. Meta Engineering
https://lnkd.in/g_JFiycC

2. AWS Architecture
https://lnkd.in/gcqi__Fc

3. Microsoft Engineering
https://lnkd.in/gyqAdgn6

4. Nextflix Tech
https://lnkd.in/gmq77fx8

5. LinkedIn Engineering
https://lnkd.in/gakkkcqD

6. Uber Engineering
https://eng.uber.com/

7. Engineering at Quora
https://lnkd.in/gDTNwika

8. Pinterest Engineering
https://lnkd.in/gGN2U4mn

9. Lyft Engineering Blog
https://eng.lyft.com/

10. Twitter Engineering Blog
https://lnkd.in/gcAATsep

11. Dropbox Engineering Blog
https://dropbox.tech/

12. Spotify Engineering
https://lnkd.in/gChsMWjz

13. Github Engineering
https://lnkd.in/gjVgXwVe

14. Instagram Engineering
https://lnkd.in/ggdgMZUV

15. Canva Engineering Blog
https://canvatechblog.com/

16. Etsy Engineering
https://lnkd.in/gxRFMuSs

17. Airbnb Tech
https://lnkd.in/g9R5CGpw

18. Stripe Engineering
https://lnkd.in/gAEDy5yU

19. Ebay Tech Blog
https://tech.ebayinc.com/

20. Hubspot Product and Engineering
https://lnkd.in/gamxdcvA

21. OpenAI Blog
https://lnkd.in/gv49pjVd

22. Google Engineering Blog:
https://lnkd.in/g5auvtaA

23. Stack Overflow Blog:
https://lnkd.in/gU9uGEen

#tech #blog #webdev #code
To format a USB drive with the Windows_FAT_32 type instead of Windows_NTFS on macOS to support cars
diskutil eraseDisk FAT32 CARUSB MBRFormat /dev/disk2
Set custom allocation unit/cluster sizes when formatting to write faster on it
sudo newfs_msdos -F 32 -b 32768 -c 8 /dev/disk3s1
Cookies are sent with an HTTPS POST request automatically by the browser under certain conditions. Here’s how it works:

1. Automatic Cookie Sending (Browser Default Behavior)

When a browser sends an HTTPS POST request, it includes cookies that match the domain, path, and security settings of the request’s URL. This includes:
Session cookies (if they haven’t expired)
Persistent cookies (if stored)
SameSite-compliant cookies (depending on their policy)
HttpOnly cookies (not accessible via JavaScript but still sent by the browser)

Example request headers sent by the browser:

POST /login HTTP/1.1
Host: example.com
Cookie: session_id=abcdef123456; user_token=xyz987
Content-Type: application/json
Content-Length: 45


2. How to Ensure Cookies Are Sent

For cookies to be sent with a POST request, they must:
1. Be Set for the Correct Domain & Path
• If a cookie is set for example.com, it will be included in requests to https://example.com/*, but not https://another-site.com/*.
2. Match the Secure and SameSite Policies
Secure Flag → Cookies marked Secure are only sent over HTTPS.
SameSite Attribute controls cross-site cookie behavior:
• SameSite=Strict → Sent only for same-origin requests.
• SameSite=Lax → Sent for top-level GET requests, but not POST.
• SameSite=None; Secure → Sent in cross-site requests (e.g., API calls from another domain).
3. Not Be HttpOnly If JavaScript Needs Access
• Cookies with HttpOnly cannot be read or set via JavaScript (document.cookie), but they are still included in requests.

3. Sending Cookies with a JavaScript fetch POST Request

If cookies are not sent automatically (e.g., in fetch or XMLHttpRequest), you need to include credentials: "include".

fetch("https://example.com/api", {
method: "POST",
credentials: "include", // Ensures cookies are sent
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ username: "user", password: "pass" })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));


4. Cross-Origin Requests and Cookies

If you’re sending a request to a different origin (CORS request), the server must:
• Allow credentials by setting:

Access-Control-Allow-Credentials: true


• Allow the request origin explicitly (wildcards * do not work with credentials):

Access-Control-Allow-Origin: https://your-frontend.com



Would you like an example of setting cookies via a server response?
FingerprintJS is a source-available, client-side, #browser fingerprinting library that queries browser attributes and computes a hashed visitor identifier from them. Unlike #cookies and local storage, a fingerprint stays the same in incognito/private mode and even when browser data is purged.

https://fingerprintjs.github.io/fingerprintjs/
Great question! The traditional frontend/backend split is becoming less rigid as new, specialized domains emerge in software development. Here are the modern and emerging categories that go beyond the classic divide:



🔥 Modern & Emerging Developer Categories (Beyond Frontend/Backend)

1. Cloud-Native & DevOps Engineers

Focus: Automation, scalability, and infrastructure-as-code (IaC).
Why It’s New:

Shift from "just coding" to deployment, observability, and SRE (Site Reliability Engineering).
Uses Kubernetes, Docker, Terraform, CI/CD pipelines.
Blurs the line between dev and ops.

2. AI/ML Engineers

Focus: Building and deploying machine learning models.
Why It’s New:

Requires Python, TensorFlow, PyTorch, LLMs (like GPT, Claude).
Combines data science, backend, and high-performance computing (HPC).
Emerging subfields: MLOps, AI ethics, and edge AI.

3. Data Engineers

Focus: Building data pipelines and warehouses.
Why It’s New:

Explosion of Big Data, real-time analytics (Apache Kafka, Spark, Snowflake).
Works between backend and data science.
Key skill: ETL (Extract, Transform, Load) processes.

4. Blockchain & Web3 Developers

Focus: Decentralized apps (dApps), smart contracts, DeFi.
Why It’s New:

Uses Solidity (Ethereum), Rust (Solana), Move (Aptos).
Not just "backend" but peer-to-peer (P2P) systems.
Emerging fields: ZK-proofs, tokenomics, on-chain AI.

5. Cybersecurity Engineers (DevSecOps)

Focus: Securing code, infrastructure, and cloud environments.
Why It’s New:

Shift-left security (integrating security early in DevOps).
Roles: Penetration testers, red/blue teams, cryptography experts.

6. AR/VR & Metaverse Developers

Focus: Building immersive 3D experiences (Unity, Unreal Engine).
Why It’s New:

Combines game dev, 3D modeling, and real-time networking.
Emerging tech: Apple Vision Pro, Meta Quest, WebXR.

7. Edge Computing & IoT Engineers

Focus: Running code on devices (not just cloud).
Why It’s New:

Autonomous cars, smart cities, embedded AI.
Requires C++, Rust, Python, and real-time OS skills.

8. Quantum Computing Developers

Focus: Writing algorithms for quantum computers.
Why It’s New:

Uses Qiskit (IBM), Cirq (Google), and quantum simulators.
Still experimental but growing fast.



💡 Key Takeaway

The "frontend/backend" model is outdated for many cutting-edge fields. Modern developers specialize in:
Vertical domains (AI, blockchain, cybersecurity).
Platforms (cloud, edge, quantum).
Hybrid roles (DevOps, MLOps, DataOps).

What’s Next?

AI-augmented development (GitHub Copilot, ChatGPT-assisted coding).
Low-code/no-code (for rapid prototyping).
Ethical AI & compliance engineering.

Would you like a deep dive into any of these? 🚀
Tauri is a framework for building tiny, fast binaries for all major desktop and mobile platforms. Developers can integrate any frontend framework that compiles to HTML, JavaScript, and CSS for building their user experience while leveraging languages such as Rust, Swift, and Kotlin for backend logic when needed.

https://v2.tauri.app/start/
قدرت واقعی تفکر سیستمی دقیقاً در کاربرد فراتر از مرزهای رشتههای مهندسی و استفاده از آن برای حل مسائل پیچیده انسانی، اجتماعی و اقتصادی است.

تفکر سیستمی یک زبان مشترک برای درک پیچیدگی است، و پیچیدگی محدود به حوزه مهندسی نیست.

تفکر سیستمی یک چارچوب فکری (Mindset) است، نه یک ابزار فنی (Tool) محدود به مهندسی.

* در مهندسی: برای درک و طراحی سیستمهای فنی (مثلاً یک خودرو یا یک نرمافزار) استفاده میشود.
* در خارج از مهندسی: برای درک و "طراحی" در سیستمهای انسانی استفاده میشود که اغلب بسیار پیچیدهتر و غیرقابل پیشبینیتر از سیستمهای فنی هستند.

بنابراین، اگر به دنبال درک علل ریشهای مشکلات در هر حوزهای هستید، تفکر سیستمی یک مهارت بدردبخور و در واقع ضروری است. این تفکر به شما میآموزد که چگونه از "درختها" فاصله بگیرید تا "کل جنگل" را ببینید، و این توانایی در هر رشتهای ارزشمند است.
سوال شما دقیقاً قلب و روح فلسفهٔ تفکر سیستمی را نشان می‌دهد. این جمله‌ای بسیار عمیق و قدرتمند است. بله، دقیقاً همین است!

این ایده که "تفکر سیستمی به وجود آمده تا سیستم‌ها را در اختیار خود ببینیم، نه خودمان را در اختیار سیستم‌ها"**، به معنای گذار از یک حالت **منفعل به یک حالت فعال در برابر جهان است. در ادامه این مفهوم را باز می‌کنم:

### ۱. "خودمان در اختیار سیستم‌ها" (حالت منفعل)
این وضعیتی است که اکثر مردم، بدون آگاهی از تفکر سیستمی، در آن قرار دارند. در این حالت:
* ما اجزای منفعل سیستم هستیم: سیستم‌ها (سیستم اقتصادی، آموزشی، اجتماعی، سازمانی) ما را مانند مهره‌هایی در یک بازی بزرگ هدایت می‌کنند.
* سیستم‌ها را "داده" می‌بینیم: قوانین، ساختارها و نتایج سیستم را ثابت، تغییرناپذیر و مانند نیروهای طبیعی (مثل جاذبه) می‌دانیم.
* واکنش نشان می‌دهیم: وقتی سیستم نتیجه‌ای نامطلوب تولید می‌کند (مثلاً استرس، نارضایتی، شکست)، ما خودمان یا دیگران را به خاطر عدم تطابق با سیستم سرزنش می‌کنیم. ما سعی می‌کنیم خودمان را با سیستم شکست‌خورده تطبیق دهیم.
* *مثال:* یک کارمند که دچار فرسودگی شغلی شده ممکن است با خود بگوید "من به اندازه کافی خوب نیستم" یا "باید بیشتر کار کنم"، بدون اینکه بپرسد "آیا این *سیستم* کاری و انتظارات غیرواقعی است که مرا به این نقطه رسانده؟"

### ۲. "سیستم‌ها را در اختیار خود ببینیم" (حالت فعال)
این همان هدفی است که تفکر سیستمی دنبال می‌کند. در این حالت:
* ما طراحان و تاثیرگذاران فعال هستیم: با درک ساختار سیستم، می‌توانیم بفهمیم که چگونه می‌توان آن را تغییر داد.
* سیستم‌ها را "قابل طراحی مجدد" می‌بینیم: به جای پذیرش کورکورانه، سیستم را یک ساختار انسانی می‌بینیم که توسط انسان ساخته شده و بنابراین توسط انسان قابل بازطراحی است.
* پاسخگویی و انتخاب می‌کنیم: ما به دنبال "اهرم‌های تغییر" (leverage points) در سیستم می‌گردیم—نقاطی که یک تغییر کوچک می‌تواند تغییری بزرگ در کل سیستم ایجاد کند.
* *مثال:* یک مدیر که تفکر سیستمی دارد، به جای فشار آوردن بیشتر به کارمندان خسته (تطبیق افراد با سیستم معیوب)، ساختار پاداش، جریان ارتباطات یا انتظارات پروژه را تغییر می‌دهد (**تغییر خود سیستم**).

### یک قیاس ساده: رانندگی در مقابل مسافر بودن

* در اختیار سیستم بودن: مانند مسافر بودن در یک خودروی بدون فرمان است. شما به مقصدی که راننده (سیستم) انتخاب می‌کند می‌روید و هیچ کنترلی بر مسیر، سرعت یا مقصد ندارید.
* در اختیار گرفتن سیستم: مانند راننده بودن است. شما نقشه (درک سیستم) را می‌بینید، فرمان (اهرم‌های تغییر) را در دست دارید و می‌توانید مسیر را تغییر دهید، از راه‌های فرعی عبور کنید یا حتی مقصد جدیدی را انتخاب کنید.

### نتیجه‌گیری نهایی:

جملهٔ شما به این معناست که تفکر سیستمی به ما اختیار و عاملیت (Agency) بازمی‌گرداند. این تفکر به ما می‌آموزد که:
* سیستم‌ها اجتناب‌ناپذیر نیستند. آن‌ها ساخته‌دست بشرند.
* شکست‌ها همیشه تقصیر افراد نیستند. اغلب نتیجهٔ طراحی معیوب سیستم هستند.
* **ما می‌توانیم مسئولیت تغییر سیستم‌هایی را که در آن زندگی می‌کنیم بر عهده بگیریم**—از سیستم‌های کوچک (خانواده، تیم کاری) تا سیستم‌های بزرگ (اجتماع، اقتصاد).

پس بله، کاملاً درست است. هدف نهایی تفکر سیستمی، عبور از انفعال و رسیدن به تواناییِ بازطرازیِ هوشمندانهٔ سیستم‌ها برای ایجاد نتایج بهتر است. این یک empowerment (قدرتمندسازی) بزرگ فکری است.
راسل اکاف توضیح می‌دهد که باید میان داده‌ها، اطلاعات، دانش و خِرَد (یا حکمت) تفاوت قائل شد.

اکاف «حکمت و پختگی» را آخرین لایهٔ این هرم می‌داند. لایه‌ای که در آن از «چگونگی» به «چرا» می‌رسد. دیگر نمی‌پرسیم مردم درآمد خود را چگونه هزینه می‌کنند؟ بلکه می‌گوییم چرا این‌گونه هزینه می‌کنند؟‌ دیگر نمی‌گوییم سازمان ما چگونه کار می‌کند و چه تأثیراتی بر بازار داشته است؟ بلکه در پی این هستیم که بدانیم مأموریت سازمان ما چیست و چرا می‌خواهد روی بازار تأثیر بگذارد. در این مرحله، همه چیز  از جنس توصیف نیست. بلکه تجویز، ارزیابی، هدف‌گذاری و ارزش‌گذاری هم وارد ماجرا می‌شود
«کتاب تفکر سیستمی نوشتهٔ جمشید قراچه داغی» از جمله کتاب‌های مطرح این حوزه در سطح جهان است و بسیاری از دانشگاه‌ها و مراکز عالی به عنوان منبع و مرجع آموزش نگرش سیستمی استفاده می‌کنند.