AI 资讯
Provide private storage for internal company documents
Create a storage account and configure high availability. Create a storage account for the internal private company documents. In the portal, search for and select Storage accounts . Select + Create . Select the Resource group created in the previous lab. Set the Storage account name to private . Add an identifier to the name to ensure the name is unique. Select Review , and then Create the storage account. Wait for the storage account to deploy, and then select Go to resource . This storage requires high availability if there’s a regional outage. Read access in the secondary region is not required. Configure the appropriate level of redundancy . Explanation A storage account is like a digital locker in the cloud. Resource group is a folder that organizes related services. High availability means your files stay safe even if one region (data center area) has problems Configure Redundancy In the storage account, in the Data management section, select the Redundancy blade . Ensure Geo-redundant storage (GRS) is selected. **Refresh **the page. Review the primary and secondary location information. Save your changes. Explanation : Redundancy means keeping copies of your files in multiple places. GRS ensures your files are copied to another region for safety. Create a storage container, upload a file, and restrict access to the file. Create a private storage container for the corporate data. In the storage account, in the Data storage section, select the Containers blade. Select + Container . Ensure the Name of the container is private . Ensure the Public access level is Private (no anonymous access). As you have time, review the Advanced settings, but take the defaults. It means: don’t change anything in the Advanced settings unless the lab specifically tells you to. Azure already chooses safe, recommended defaults for you. Select Create . Explanation : A container is like a folder inside your storage account. Setting Public access level to Private means nobody can see
AI 资讯
Kubernetes vs Docker (2026): What's the Difference and Which Should You Learn First?
📌 This article was originally published on Sherdil E-Learning . I'm republishing it here so the dev.to community can benefit too. The Kubernetes vs Docker question is one of the most common sources of confusion for developers entering DevOps. People hear both names constantly, see them used together in job listings, and assume they must be competitors. They are not. Docker and Kubernetes do different jobs, and most modern infrastructure uses both. This guide explains what each tool actually does, how they fit together in a real deployment, the practical difference between Docker Compose and Kubernetes, and which one you should learn first. Docker: the container creator Docker is a tool for building, running, and managing containers . A container is a lightweight, portable package that contains an application together with its dependencies, runtime, system libraries, environment variables, and configuration files. The same container runs the same way on a laptop, a CI runner, a production server, or a cloud platform. In a typical Docker workflow you: Write a Dockerfile that describes how to build the image Run docker build to produce the image Run docker run to launch a container from it For multiple containers (a web app plus a database, for example), you use Docker Compose to define the whole set in a docker-compose.yml file and start them with one command. Docker is excellent for individual containers and small multi-container applications. The limitation is scale. What happens when you need a hundred containers across a dozen servers? When one container crashes at 3 a.m.? When you need to roll out a new version without downtime? Docker alone does not solve those problems. For the official reference, see docs.docker.com . Kubernetes: the orchestration layer above Docker Kubernetes (often shortened to K8s ) is an open-source platform that runs containers across many machines as a single coordinated system . It was originally built at Google, based on their internal
产品设计
How a Culture of Data-Driven Conversations Can Support Platform Engineering
To provide SRE as a service, a team built a center of excellence, introducing Federated SREs and roles like production manager and technical tribe lead. They created a culture of data-driven conversations where SLOs and SLAs were democratised. Surviving growing cognitive load meant continuously simplifying architecture and embedding sovereignty and resilience into platform design decisions. By Ben Linders
AI 资讯
If a company serves 2 countries, would you recommend having 2 website portals/landings? And also to hide a country mention from the other country?
Here is the situation of the website. If someone in Canada enters www.example.com they are redirected to www.example.com/ca and ALL the mention of "USA" is hidden and replaced with "Canada"! For example in Canada, instead of people seeing "Home Improvement in the USA and Canada", people in Canada just see "Home improvement in Canada", and vice versa; someone in USA and everywhere other than Canada on the globe does NOT see Canada on the website pages . My question is: Shouldn't a website have unified info and list BOTH USA and Canada, because with current situation someone accessing the homepage in Canada would NOT know that the company can also do Home improvement in the USA and vice versa . Even for AIs, I asked Chatgpt where is the company located and did NOT see Canada. P.S. The only mention of both countries is in the contact page. submitted by /u/RadiantQuests [link] [留言]
开发者
Wraplet vs Web Components
submitted by /u/enador [link] [留言]
AI 资讯
Stop Hardcoding 301s: How I Built a Redirect Engine That Doesn't Break at 2 A.M.
Marketing wants an A/B landing page by Friday. Product wants to gracefully deprecate a legacy API without breaking old mobile clients. Growth wants ten thousand short links, and Ops does not want ten thousand Nginx edits. At some point, a single return 301 in your CDN stops being a configuration problem and becomes a routing product . Someone has to answer, on every HTTP request: Given this host, path, query, and method—where does this visitor go, and with which status code? I built that answer as a pipeline at LinkShift . Not a pile of special cases, but a fixed sequence of steps that runs the exact same way for real visitors and for the tools you use to test rules before rollout. Here is how I designed a deterministic redirect engine, the pipeline that powers it, and the edge cases that kept me up at night so they don't have to keep you up. Why "Usually Works" Is Not Enough A redirect engine fails quietly. The browser follows a broken 302 and nobody files a ticket. The damage shows up days later in analytics: wrong campaign, wrong locale, or an infinite loop that only appears when two rules on the same host point at each other. What I wanted early on was boring, bulletproof reliability: Same inputs → same decision. Two engineers simulating the same request against the same rule set should get the same target URL. Same resolution logic everywhere. Matching and destination resolution must not diverge between the "Test Rule" button in the dashboard and an actual click on a custom domain. Guards before cleverness. Rate limits and access checks run before anyone evaluates a ternary conditional in a destination string. Expressiveness is easy. Ordering is what saves you in production. The Pipeline, Told as a Story Picture a request hitting a hostname. Before the engine asks "which rule wins?", the request walks through a strict corridor of gates. Only then does it enter the rule loop. Gate 1: The Host Has to Exist If the hostname does not resolve to a domain or LinkShift
开发者
Building Accessible Frontend Components: A Practical Guide to Inclusive UI Patterns
Liquid syntax error: Variable '{{% raw %}' was not properly terminated with regexp: /\}\}/
AI 资讯
Serverless Framework Deployment: Unleash the Power of AWS Lambda
Let me tell you exactly what happened the first time I tried to set up Lambda manually. Four hours. IAM trust policies I didn't fully understand, ARNs copy-pasted into the wrong fields, an API Gateway that was technically configured but somehow not routing anything correctly, and a deploy that failed with an error message pointing me nowhere useful. I hadn't written a single line of actual business logic yet. That's when someone on my team mentioned the Serverless Framework. My first reaction was honestly skepticism — another abstraction layer sounded like another thing to learn and eventually fight with. I was wrong about that. This isn't a "look how clean this tool is" post. It's more like: here's what I actually did to get a Postgres-backed CRUD API running on Lambda, step by step, including the parts that tripped me up. What the Framework Is Actually Doing Under the Hood Worth knowing before you start: the Serverless Framework isn't magic. It's generating CloudFormation templates and submitting them to AWS on your behalf. Your Lambda functions, API Gateway routes, CloudWatch log groups — all of it gets provisioned from a single config file. It works with other providers too, but the AWS integration is where it really earns its keep. The console clicking and manual ARN-wiring that burns time at the start of every serverless project? Gone. Same deploy workflow whether you're building a REST API, an event processor, or a cron job. Once you've done it once, the second project takes a fraction of the time. What You're Building Four live endpoints backed by PostgreSQL. A Users table. Create, read, update, delete — nothing exotic, but a real enough foundation that you can extend it into something actual once this guide is done. You'll need an AWS account, the AWS CLI installed, and the Serverless Framework installed before starting. That's it. Step 1: Sort Out Your AWS Credentials Run this to create both config files in one go: bash cat << EOF > ~/.aws/credentials [def
AI 资讯
AI-Assisted QA Changes the Testing Job, Not the Testing Need
Internal note to the team, we need to improve test coverage and keep shipping, which means we should treat AI as a helper in the workflow, not as a replacement for testing discipline. AI-assisted development changes the shape of our risk. It can produce more code faster, but it also increases the chance that small logic mistakes, brittle selectors, and shallow test cases slip through review. The answer is not to add more manual checking everywhere. The answer is to be more deliberate about what we review, what we automate, and where we let AI help. What changes when AI writes part of the code The first thing that changes is review. When a developer uses AI to draft a feature, a test, or a refactor, the reviewer is no longer only checking intent and style. The reviewer also needs to check whether the generated code matches the product rule, whether it introduced a hidden dependency, and whether it quietly weakened coverage. That does not mean every AI-assisted change deserves extra ceremony. It means our review checklist should shift from "does this look correct" to "what did the model assume, and did we verify those assumptions?" That is especially important for test code, because generated tests often look plausible even when they do not prove much. Coverage should move from volume to signal AI tends to produce more test cases, but more cases are not the same as better coverage. If a generated test suite repeats the same happy path under slightly different names, the team gets a false sense of safety. Coverage should answer a more practical question, where are we most likely to break the user experience, and where will a test actually catch it? For chat and other AI features, prompt-by-prompt manual checks are a trap. They do not scale, and they encourage a habit of eyeballing output instead of verifying behavior. A better pattern is to build assertions around expected properties, create eval sets for representative prompts, and add regression coverage for failure
开发者
How to Build a Browser Tool and Sell It on Gumroad — A Complete Guide
I built 24 browser-based tools. Here is the complete technical guide for building your own and selling PRO licenses on Gumroad. Architecture: One HTML File + GitHub Pages + Gumroad No frameworks, no backend, no monthly costs. One HTML file on GitHub Pages. Gumroad handles payments. The PRO Flow User hits free limit → PRO modal Buy button → Gumroad popup ( window.open , NOT target=_blank ) Payment → Gumroad postMessage with license key message listener catches key Key verified via Gumroad API ( /v2/licenses/verify ) localStorage saves PRO (in try-catch!) Gotchas From 24 Tools postMessage security: Check d.success && d.purchase , never just d.license_key . I had this bug in 17 files. localStorage: Wrap in try-catch . Uncaught throws crash the whole page. CDN scripts: Always <script defer> . Without it, slow CDN blocks rendering. Gumroad publish: curl returns false every time. Use PowerShell. Buy button: Popup connects the page to Gumroad. Redirect breaks postMessage . Packed 5 templates with everything pre-configured: Browser Tools Starter Kit ($19)
AI 资讯
peektea narrows its gaze 👀 filter-as-you-type and hidden files
Hello, I'm Maneshwar. I'm building git-lrc, a Micro AI code reviewer that runs on every commit. It is...
开发者
How do you decide a side project is "good enough" to ship instead of polishing forever?
Solo dev here. My biggest bottleneck isn't building, it's deciding when something is done. I keep polishing past the point of diminishing returns and delay shipping for weeks over things no user would notice. For those who ship regularly: - What's your actual "ship it" threshold? - Do you use a hard rule (a deadline, a checklist, a launch date you can't move), or is it a feel thing? - Has shipping earlier than felt comfortable ever hurt you? Trying to build a saner habit around this. How do you draw the line? submitted by /u/IcyButterscotch8351 [link] [留言]
开发者
Winner Announcement Delayed for the Google I/O 2026 Writing Challenge
Hey all, we have a quick update for everyone who participated in the Google I/O Writing...
开发者
How to add eslint-disable comments in pug code inside a Vue SFC file?
Hi! I'm having some trouble with eslint-disable comments for HTML elements defined inside a Vue SFC pug template, eslint do not recognize them and keeps throwing warnings. What I've tried so far: Comments inside the pug template, both // and //- <template lang="pug"> // eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -- Standard video player click-to-play-pause behavior video(@click="togglePause" ...) </template> <template lang="pug"> //- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -- Standard video player click-to-play-pause behavior video(@click="togglePause" ...) </template> My next options are not optimal, but I ran out of ideas: A comment inside the script setup tag (it is placed before the template in the file): <script setup> //eslint-disable vuejs-accessibility/no-static-element-interactions </script> A comment at the very top of the file, before any other code <!-- eslint-disable vuejs-accessibility/no-static-element-interactions --> <script setup></script> <template lang="pug"></template> None of this worked. The only way I managed to make this work was creating overrides in .eslintrc.cjs: // Since eslint-disable comments do not work for HTML elements inside pug we // must include those overrides here. overrides: [ { // Standard video player click-to-pause behavior files: ["src/components/common/SimpleMp4Viewer.vue"], rules: { "vuejs-accessibility/no-static-element-interactions": "off" } } ] Do you know if I am missing something here? The eslint related packages I have in my projects are: dependencies "eslint-config-prettier": "^10.1.8", devDependencies "@rushstack/eslint-patch": "^1.8.0", "@vue/eslint-config-prettier": "^9.0.0", "eslint": "^8.57.0", "eslint-define-config": "^2.1.0", "eslint-plugin-unused-imports": "^4.4.1", "eslint-plugin-vue": "^9.27.0", "eslint-plugin-vue-pug": "^0.6.2", "eslint-plugin-vuejs-accessibility": "^2.5.0", Thank you! submitted by /u/bcons-php-Console [link] [留言]
开发者
Studied how the News Feed works in Instagram and other social media platforms.
One important concept I learned is Fanout, which is basically how posts are distributed to user's feeds. Fanout Push When a user creates a post, the system immediately pushes that post to the feed cache of all followers. This is very fast because the feed is already prepared when users open the app. Fanout Pull Instead of precomputing feeds, the system generates the feed when a user opens the application by fetching posts from accounts they follow. It saves storage and avoids unnecessary work for accounts with huge follower counts. Now real system user Hybrid Approach For normal users with a few hundred followers, Fanout Push works well because the cost is manageable and feed loading is fast. For celebrities like Virat Kohli with 250M+ followers, pushing every post to every follower's feed cache would be extremely expensive. Many followers may not even open the app, so a lot of storage and compute would be wasted. That's why large scale systems often use Fanout Pull (or a hybrid approach) for such accounts. But How Does the Feed Know to Fetch Celebrity Posts? A question I had was: If my normal friends' posts are already present in my feed cache through Fanout Push, how does the system know that it should also fetch posts from celebrity accounts? One possible approach is that the social graph stores metadata about accounts. Celebrity or high follower accounts can be marked differently. When a user opens the app, the Feed Service: Loads the feed generated through Fanout Push. Checks the accounts the user follows in the Social Graph. Identifies celebrity accounts that use Fanout Pull. Fetches their latest posts separately. Merges both results and then applies recommendation algorithms before returning the final feed. Simplified Flow User Creates Post Post Service Store in Database Fanout Service Check Social Graph & User Preferences (blocked users, muted users, close friends, etc.) Create Fanout Tasks Message Queue Fanout Workers (Push or Pull Strategy) I'm still learn
AI 资讯
ACID vs BASE: What Database Guarantees Actually Promise
When people say a database is "ACID-compliant" or "eventually consistent," they are making promises about what happens when things go wrong — concurrent writes, crashes, network failures. ACID and BASE are the two vocabularies for those promises, and knowing the difference tells you what you can and cannot rely on. What ACID guarantees ACID is the contract that traditional transactional databases — PostgreSQL, MySQL/InnoDB, Oracle, SQLite — make about a transaction (a group of operations treated as one unit). The four letters: Atomicity : the whole transaction succeeds or none of it does. If a bank transfer debits one account but the credit fails, the debit is rolled back. There is no half-done state. Consistency : a committed transaction moves the database from one valid state to another, never violating its declared rules (constraints, foreign keys, types). It will not let you, say, leave a foreign key pointing at a row that does not exist. Isolation : concurrent transactions do not step on each other. The result is as if they ran one at a time, even when they actually ran in parallel. (In practice databases offer tunable isolation levels — from "read committed" to "serializable" — trading strictness for speed.) Durability : once the database says "committed," that data survives a crash or power loss. It has been written somewhere persistent, not just held in memory. The payoff is that you can reason about your data simply: after a successful commit, the world is exactly what you asked for. The cost is coordination, which gets expensive when data is spread across many machines. What BASE trades away BASE is the model many distributed and NoSQL systems adopt — think Cassandra, DynamoDB, or Riak — when they need to scale across many nodes and stay up through failures. The acronym is deliberately a chemistry pun on ACID, and it stands for: Basically Available : the system answers requests even during partial failures, possibly with stale or incomplete data rather tha
AI 资讯
How Git Actually Stores Your Code: Blobs, Trees, and Commits
Most people picture Git as a tool that records changes — a stack of diffs layered on top of each other. That mental model is wrong, and it makes Git feel mysterious. Git is really a small key-value database that stores snapshots, and once you see the four object types it uses, commands like reset , checkout , and rebase stop being magic. Git is a content-addressed object store Everything Git tracks lives in .git/objects as an object, and every object has an ID that is the hash of its own content. By default that hash is a 40-character SHA-1 digest (newer Git supports SHA-256). The same bytes always produce the same ID, so the ID is the content's address — change one byte and you get a completely different object. This is why Git data is effectively immutable: you never edit an object in place, you create a new one with a new name. You can look inside any object with git cat-file . The -t flag prints the type, -p pretty-prints the content: $ git cat-file -t 3b18e512 blob $ git cat-file -p 3b18e512 hello world There are exactly four object types: blob , tree , commit , and tag . A blob is just file contents — raw bytes, with no filename and no metadata. The blob for README.md knows nothing about being named README.md ; it only knows what's inside. A tree is a directory listing. It maps names to other objects: each entry has a mode (like a file vs. an executable vs. a subdirectory), a name, and the hash of either a blob (a file) or another tree (a subdirectory). Trees are how Git represents folder structure. Inspecting one shows exactly that: $ git cat-file -p HEAD^ { tree } 100644 blob a906cb... README.md 040000 tree fe8e3b... src A commit ties it together. A commit object points to exactly one top-level tree (the full state of your project at that moment), plus the hash of its parent commit (or parents, for a merge), the author and committer with timestamps, and the commit message. Running git cat-file -p HEAD shows these fields in plain text. Because each commit nam
AI 资讯
I built a Windows tool that turns screenshots into one searchable PDF — here's what I learned
For months I had the same annoying problem: folders full of screenshots I couldn't actually use. Lecture slides, PDFs I own, scanned pages — all just images . I couldn't Ctrl-F them, couldn't copy a line out, couldn't get my OS to index them. A picture of text is useless the moment you need to find something in it. So I built CapDrop to automate the whole chain on Windows. This is a write-up of how it works under the hood and the bugs that nearly broke me. The core idea You draw a capture box over a page, pick a page key (Page Down, arrow keys), set an interval, and walk away. CapDrop then: Captures each page on the interval Presses the page key for you to advance Auto-crops margins and toolbars out of every shot Runs OCR locally Binds everything into a single PDF with a real text layer The result is one document you can search, not a pile of images. The stack Electron for the app shell and capture/UI (I already had window management, hotkeys, and floating-bubble export working — no reason to rewrite). A Python OCR sidecar (RapidOCR) spawned as a child process. OCR runs 100% locally; nothing is ever uploaded. jimp for auto-crop, with a 12px safety pad so edge text never gets clipped. pdf-lib to bind the pages and inject the OCR text layer. The Electron + Python-sidecar split was a deliberate choice. People kept telling me to rewrite the whole thing in Python "for the OCR," but the Electron app already had everything except OCR. Adding a sidecar was a few hundred lines; a rewrite would've been months. The bug that cost me two days After adding the OCR pipeline, my global capture hotkey developed a 4-second delay on the first press. Cold, every time. I guessed wrong twice — thumbnail size, then a race condition. Both were dead ends. The only thing that actually found it was instrumenting the hot path with timing logs. The culprit: a fs.readFile of a tiny 749-byte settings.json on every hotkey press. On a cold start that read was taking 2–4 seconds — Windows Defender's
AI 资讯
MD5 Is Broken — Stop Using It for Passwords (Use SHA256 Instead)
MD5 Is Broken — Stop Using It for Passwords (Use SHA256 Instead) MD5 was invented in 1991. It's 2026, yet I still see developers using MD5 for password hashing in production systems. Let’s break down why this is dangerous and what you should use instead. What Is a Hash Function? A hash function takes any input and produces a fixed-length output called a digest or hash . It is a one-way function , meaning you cannot reverse it to get the original input. Example: ```text id="hash1" Input: "password123" MD5: 482c811da5d5b4bc6d497ffa98491e38 SHA256: ef92b778bafe771e89245b89ecbc08a44a4e166c06659911881f383d4473e94f Even a small input change completely changes the output. --- # Why MD5 Is Broken MD5 generates a **128-bit hash**, which was considered secure decades ago. Today, it's extremely weak. Modern GPUs can compute **billions of MD5 hashes per second**, making brute-force attacks trivial. --- ## The Rainbow Table Problem Attackers use precomputed databases called **rainbow tables**. These tables map common passwords → their hash values. So if you hash: ```text "password123" → MD5 → known value An attacker can instantly look it up. Collision Vulnerabilities Researchers have demonstrated that two different inputs can produce the same MD5 hash . This breaks the core security guarantee of hash functions. SHA256 — The Better Choice SHA256 produces a 256-bit hash and is part of the SHA-2 family. It is currently considered cryptographically secure. Example: ```text id="sha1" "hello" → 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 Even tiny changes completely change the output: ```text "hello" → 2cf24dba... "Hello" → 185f8db3... But Wait — Don’t Use SHA256 for Passwords Either This is where many developers make a mistake. SHA256 is not suitable for password hashing . Why? Because it is too fast . Fast hashing allows attackers to brute-force passwords quickly using GPUs. What You Should Use Instead For password storage, use: bcrypt scrypt Argon2 (recommended
产品设计
[Showoff Saturday] I built a real-time collaborative pixel canvas with regional teams
I built a small real-time web experiment called WeSearch Canvas. It’s a shared public pixel canvas where everyone sees the same board and can place one pixel every few seconds. No signup. No feed. No account system. Users are automatically grouped into regional teams, and regions climb the board based on activity. The product idea is simple, but the interesting part for me is the interaction loop: - extremely low-friction entry - real-time shared state - cooldown-based contribution - region/team identity without account creation - social pressure to invite others from your area - canvas archive for past boards I’m trying to keep it lightweight and avoid the usual overbuilt social-app trap. The question is whether the loop is strong enough without accounts, profiles, chat, or notifications. I’d appreciate web/product feedback on: First-load clarity Real-time interaction feel Mobile usability Whether the region mechanic is obvious Any obvious scaling or abuse issues I should plan around early Link: https://wesearch.press/canvas submitted by /u/OGMYT [link] [留言]