Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Month: August 2026

Photoshop

Photoshop: Fix Layers That Won’t Align No Matter How Carefully You Drag Them

- 31.08.26 - ErcanOPAK comment on Photoshop: Fix Layers That Won’t Align No Matter How Carefully You Drag Them

πŸ–ŒοΈ Align Left, Align Center – Nothing Moves the Way It Should You select two or more layers and click an alignment button, expecting them to snap neatly into place relative to each other – and instead they either don’t move at all, or they align to something completely unexpected, like the entire canvas instead […]

Read More
Wordpress

WordPress: Speed Up a Slow Site Without Touching a Single Line of Code

- 31.08.26 - ErcanOPAK comment on WordPress: Speed Up a Slow Site Without Touching a Single Line of Code

πŸ“ Make Your Site Noticeably Faster Without Touching a Line of Code A slow WordPress site is usually treated as a developer problem – but most of the biggest, easiest speed wins are configuration and plugin choices anyone comfortable in wp-admin can make directly, no code required. 🐞 The Problem PageSpeed Insights: 34/100 mobile score […]

Read More
Docker

Docker: Fix a Multi-Stage Build That Copies Files From the Wrong Stage

- 31.08.26 - ErcanOPAK comment on Docker: Fix a Multi-Stage Build That Copies Files From the Wrong Stage

🐳 The Build Succeeds – The Final Image Is Missing Half Your App A multi-stage Dockerfile builds without any errors, but the final image is missing files that were clearly built successfully in an earlier stage – or worse, contains stale files from a completely unrelated earlier build, because a COPY –from= pointed at the […]

Read More
Ajax

Ajax: Fix a Request That Overwrites Newer Data With an Older Response That Arrived Late

- 31.08.26 - ErcanOPAK comment on Ajax: Fix a Request That Overwrites Newer Data With an Older Response That Arrived Late

πŸ”„ The Newest Request Isn’t Always the One That Finishes Last A user types quickly into a live-search box, firing off a request on every keystroke. The requests don’t always come back in the order they were sent – and when an older, slower response arrives AFTER a newer, faster one, it silently overwrites the […]

Read More
AI

The AI Prompt That Plans a Realistic Moving-Day Checklist Down to the Hour

- 31.08.26 - ErcanOPAK comment on The AI Prompt That Plans a Realistic Moving-Day Checklist Down to the Hour

πŸ€– The AI Prompt That Plans Your Moving Day Down to the Hour So Nothing Gets Forgotten Moving day has a hundred small logistics that are easy to forget in the chaos – utility transfers, address updates, what to pack last vs. first, what needs to be accessible the moment you arrive. This prompt turns […]

Read More
Git

Git: Stop Committing Large Binary Files by Accident With a Pre-Commit Hook

- 31.08.26 - ErcanOPAK comment on Git: Stop Committing Large Binary Files by Accident With a Pre-Commit Hook

πŸ”€ One Accidental 400MB Video File Commit – and It’s in History Forever Someone on the team accidentally commits a large binary file – a video, a database dump, a build artifact – straight into the repository. It gets caught in review and reverted in a later commit, but the repository stays bloated forever, because […]

Read More
JavaScript

JavaScript: Fix a Memory Leak Caused by Event Listeners You Forgot to Remove

- 31.08.26 - ErcanOPAK comment on JavaScript: Fix a Memory Leak Caused by Event Listeners You Forgot to Remove

⚑ The Page Gets Slower the Longer It Stays Open – Here’s Why A single-page app feels snappy right after loading, then gradually gets sluggish the longer a user keeps it open, especially after navigating between views repeatedly. Nothing crashed – the browser’s memory usage just keeps climbing, and it never comes back down. 🐞 […]

Read More
AI

The AI Prompt That Reviews Your API Design for Consistency Before You Ship It

- 31.08.26 - ErcanOPAK comment on The AI Prompt That Reviews Your API Design for Consistency Before You Ship It

πŸ€– Catch Inconsistent API Design Before Your Consumers Do One endpoint returns dates as ISO strings, another returns Unix timestamps. One uses camelCase, another snake_case. One paginates with page/pageSize, another with offset/limit. None of these are individually wrong – together, they make an API exhausting to integrate with, and this prompt catches the drift before […]

Read More
SQL

SQL Server: Fix a Stored Procedure That Runs Fast Alone but Slow When Called From the App

- 31.08.26 - ErcanOPAK comment on SQL Server: Fix a Stored Procedure That Runs Fast Alone but Slow When Called From the App

πŸ—„οΈ Run It in SSMS: Instant. Call It From the App: Ten Seconds. The exact same stored procedure, with what looks like the exact same parameters, runs instantly when you execute it directly in SQL Server Management Studio – and takes ten seconds every time the application calls it. Nothing about the query changed between […]

Read More
Windows

Windows 11: Fix a Taskbar That Won’t Show the Notification Icons You Pinned

- 31.08.26 - ErcanOPAK comment on Windows 11: Fix a Taskbar That Won’t Show the Notification Icons You Pinned

πŸͺŸ You Pinned It to the Taskbar – It’s Just Not Showing Up An app icon you deliberately chose to always show in the taskbar’s notification area disappears – either right after an update, or gradually over a few reboots – leaving you to open the hidden icons flyout every time just to check something […]

Read More
C#

C#: Why String.Format Culture Mismatches Silently Corrupt Numbers on a Different Locale Machine

- 31.08.26 - ErcanOPAK comment on C#: Why String.Format Culture Mismatches Silently Corrupt Numbers on a Different Locale Machine

πŸ”§ It Worked on Your Machine – It Formatted Numbers Wrong on Theirs Code that formats a price or a date runs perfectly on your development machine, then produces subtly wrong output the moment it runs on a server or a user’s PC configured for a different region — commas where periods should be, day […]

Read More
Photoshop

Photoshop: Recover an Unsaved File After Photoshop Crashes Mid-Edit

- 31.08.26 - ErcanOPAK comment on Photoshop: Recover an Unsaved File After Photoshop Crashes Mid-Edit

πŸ–ŒοΈ Photoshop Crashed Mid-Edit – Your Work Might Still Be There An hour of careful editing, no save in a while, and Photoshop crashes or the computer freezes and needs a hard restart. It feels like everything is gone – but Photoshop has more than one safety net built in, and checking them takes far […]

Read More
Asp.Net Core

ASP.NET Core: Why Your API Returns 401 Even Though the Token Looks Valid

- 31.08.26 - ErcanOPAK comment on ASP.NET Core: Why Your API Returns 401 Even Though the Token Looks Valid

βš™οΈ The Token Decodes Fine – The API Still Says Unauthorized You paste the JWT into a decoder, every claim looks correct, the signature checks out, the token clearly hasn’t expired by the clock on your screen – and the API still returns 401 Unauthorized on every single request. 🐞 The Problem HTTP/1.1 401 Unauthorized […]

Read More
Visual Studio

Visual Studio: Fix the XAML Designer That Crashes Every Time You Open a Specific File

- 31.08.26 - ErcanOPAK comment on Visual Studio: Fix the XAML Designer That Crashes Every Time You Open a Specific File

πŸ› οΈ Every Other XAML File Opens Fine – This One Crashes the Designer Every Time The XAML designer works normally across the whole solution, and one specific file reliably crashes it – or freezes Visual Studio entirely – the instant you try to open its design view, forcing you to edit that one file blind, […]

Read More
Git

Git: Recover a Stash You Accidentally Dropped

- 31.08.26 - ErcanOPAK comment on Git: Recover a Stash You Accidentally Dropped

πŸ”€ git stash drop Deleted Work You Actually Needed – It’s Still Recoverable You clean up old stashes with git stash drop (or stash pop went wrong and cleared the entry), only to realize seconds later that one of them had uncommitted work you actually still needed. It feels gone – it almost always isn’t. […]

Read More
HTML

HTML5: Fix Autofill That Fills the Wrong Field Because of Missing autocomplete Attributes

- 31.08.26 - ErcanOPAK comment on HTML5: Fix Autofill That Fills the Wrong Field Because of Missing autocomplete Attributes

🧩 The Browser Fills In the Wrong Field Every Single Time A checkout form has separate fields for billing and shipping address, and the browser’s autofill keeps putting the wrong data in the wrong field – or ignoring the form entirely – frustrating users who expect one-click autofill to just work like it does everywhere […]

Read More
CSS

CSS: Fix a Sticky Header That Stops Sticking Inside a Scrollable Parent

- 31.08.26 - ErcanOPAK comment on CSS: Fix a Sticky Header That Stops Sticking Inside a Scrollable Parent

🎨 position: sticky Works Everywhere Except Inside This One Container A sticky header works perfectly when tested on its own, and the moment it’s placed inside a scrollable card or panel, it stops sticking entirely – scrolling right past the top of its container as if position: sticky had no effect at all. 🐞 The […]

Read More
AI

The AI Prompt That Turns a Pull Request Diff Into a Focused List of Risky Changes to Double-Check

- 31.08.26 - ErcanOPAK comment on The AI Prompt That Turns a Pull Request Diff Into a Focused List of Risky Changes to Double-Check

πŸ€– Turn a 40-File Pull Request Into the 5 Lines That Actually Need Your Attention A pull request touches 40 files, and most of them are safe, mechanical changes – a rename, a formatting pass, an import reorder. This prompt filters straight to the handful of changes that carry real risk, so review time goes […]

Read More
Kubernetes

Kubernetes: Fix a Pod Stuck in CrashLoopBackOff Because of a Missing Environment Variable

- 31.08.26 - ErcanOPAK comment on Kubernetes: Fix a Pod Stuck in CrashLoopBackOff Because of a Missing Environment Variable

☸️ CrashLoopBackOff, and the Logs Point at One Missing Environment Variable A pod deploys, starts, crashes almost immediately, and Kubernetes keeps restarting it with increasing backoff delay – the textbook CrashLoopBackOff pattern. The container logs (easy to miss looking at) reveal the actual cause: the application is failing fast because a required environment variable was […]

Read More
Wordpress

WordPress: Fix a Contact Form That Stops Sending Emails After a Host Migration

- 31.08.26 - ErcanOPAK comment on WordPress: Fix a Contact Form That Stops Sending Emails After a Host Migration

πŸ“ The Form Submits Successfully – The Email Never Arrives A contact form worked reliably for months, and right after migrating to a new host, submissions still show a ‘Message sent!’ success message – but the emails themselves stop arriving. Nothing about the form’s code or settings changed; the new server environment did. 🐞 The […]

Read More
C#

C#: Fix the Null Reference Exception That Only Happens After Awaiting an Async Method

- 31.08.26 - ErcanOPAK comment on C#: Fix the Null Reference Exception That Only Happens After Awaiting an Async Method

πŸ”§ The Object Was Never Null – Until You Awaited Something A method reads a field, awaits an async call, then reads that same field again a few lines later — and the second read throws a NullReferenceException, even though nothing in the visible code path ever set it to null. 🐞 The Problem public […]

Read More
Asp.Net Core

ASP.NET Core: Fix Model Binding That Silently Returns Null for a Perfectly Valid Request Body

- 31.08.26 - ErcanOPAK comment on ASP.NET Core: Fix Model Binding That Silently Returns Null for a Perfectly Valid Request Body

βš™οΈ The Request Body Looks Perfect – The Model Still Comes Back Null You POST a well-formed JSON body to an endpoint, ModelState.IsValid says true, and yet the parameter your action method receives is null or has every property at its default value – no error, no exception, just quietly wrong data. 🐞 The Problem […]

Read More
SQL

SQL Server: Recover Data From a Corrupted Database Using DBCC CHECKDB Before You Panic

- 31.08.26 - ErcanOPAK comment on SQL Server: Recover Data From a Corrupted Database Using DBCC CHECKDB Before You Panic

πŸ—„οΈ Before You Restore From Backup, Run This One Command A query suddenly throws a corruption error – torn page, checksum mismatch – and the instinct is to panic and start restoring from last night’s backup immediately, losing a full day of transactions. There’s a faster, less destructive first step almost everyone skips. 🐞 The […]

Read More
Windows

Windows 11: Recover Files After Emptying the Recycle Bin by Accident

- 31.08.26 - ErcanOPAK comment on Windows 11: Recover Files After Emptying the Recycle Bin by Accident

πŸͺŸ Recycle Bin Emptied by Mistake – It’s Not Necessarily Gone A quick ‘Empty Recycle Bin’ click, done on autopilot, turns out to have included a file you actually still needed. It feels final and irreversible – but as long as you act quickly and stop using that drive, there’s a real chance of getting […]

Read More
C#

C#: Why Modifying a Collection While Foreach-ing Over It Throws (And the Safe Way to Do It)

- 31.08.26 - ErcanOPAK comment on C#: Why Modifying a Collection While Foreach-ing Over It Throws (And the Safe Way to Do It)

πŸ”§ Removing an Item Mid-Loop Throws – Here’s the Safe Way You loop through a list looking for items to remove, call Remove() the moment you find one, and immediately get an InvalidOperationException about the collection being modified. The intent was reasonable – the approach just isn’t allowed. 🐞 The Problem var expired = new […]

Read More
C#

C#: Why Comparing Two decimal Values With == Can Still Surprise You (Trailing Zeros and Scale)

- 31.08.26 - ErcanOPAK comment on C#: Why Comparing Two decimal Values With == Can Still Surprise You (Trailing Zeros and Scale)

πŸ”§ == Says They’re Equal, ToString Says They’re Not 1.10m and 1.1m compare equal with == every time – decimal’s equality operator normalizes value correctly. The surprise shows up one step later, when you format both for a receipt, a hash, or a string comparison and get 1.10 and 1.1 back — two different-looking strings […]

Read More
AI

The AI Prompt That Finds Every Hardcoded Secret and Magic Number Before Code Review

- 31.08.26 - ErcanOPAK comment on The AI Prompt That Finds Every Hardcoded Secret and Magic Number Before Code Review

πŸ€– Catch the Hardcoded API Key Before Your Reviewer Has To A hardcoded connection string, an API key pasted in for ‘just testing,’ a magic number like 86400 with no comment explaining it – these slip through code review constantly because reviewers are scanning for logic bugs, not scanning every literal value in the diff. […]

Read More
Photoshop

Photoshop: Fix Text That Renders Blurry No Matter What Resolution You Export At

- 31.08.26 - ErcanOPAK comment on Photoshop: Fix Text That Renders Blurry No Matter What Resolution You Export At

πŸ–ŒοΈ You Bumped the Export Resolution – The Text Is Still Blurry You export a design at 300 DPI expecting crisp text, and it still comes out soft and blurry no matter how high you push the resolution. Resolution isn’t actually the problem here – it’s what happened to the text layer somewhere earlier in […]

Read More
Photoshop

Photoshop: Recover a Selection You Lost Before Finishing a Complex Mask

- 31.08.26 - ErcanOPAK comment on Photoshop: Recover a Selection You Lost Before Finishing a Complex Mask

πŸ–ŒοΈ One Wrong Click and 20 Minutes of Careful Selection Work Is Gone You’ve spent a long stretch carefully refining a complex selection – hair, fine edges, tricky transparency – and then click somewhere that deselects everything before you got the chance to turn it into a mask. The good news: Photoshop almost always still […]

Read More
Visual Studio

Visual Studio: Fix a Solution That Won’t Load Because of a Missing Project Reference

- 31.08.26 - ErcanOPAK comment on Visual Studio: Fix a Solution That Won’t Load Because of a Missing Project Reference

πŸ› οΈ The Solution Opens – One Project in It Refuses To You open a solution that’s built fine for months, and suddenly one project in it shows up greyed out or fails to load entirely, with an error about a missing or unloadable project reference. Nothing about that project’s own code changed – something it […]

Read More
Page 1 of 16
1 2 3 4 5 6 … 16 Next Β»

Posts pagination

1 2 3 … 16 Next »
August 2026
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Jul   Sep »

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (973)
  • How to make theater mode the default for Youtube (952)
  • How to add default value for Entity Framework migrations for DateTime and Bool (939)
  • Get the First and Last Word from a String or Sentence in SQL (847)
  • How to select distinct rows in a datatable in C# (837)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (624)
  • Add Constraint to SQL Table to ensure email contains @ (590)
  • Average of all values in a column that are not zero in SQL (553)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (526)
  • Find numbers with more than two decimal places in SQL (468)

Recent Posts

  • CSS: Fix a prefers-color-scheme Media Query That Gets Silently Overridden by a Browser Extension’s Forced Dark Mode
  • Git: Fix a Merge Commit That Silently Drops a File Because Both Branches Deleted It Differently
  • HTML5: Fix a Native Lazy-Loading Image That Never Loads Because It Sits Inside a Hidden Tab Until the User Clicks It
  • The AI Prompt That Traces a Null Reference Exception Back to the Exact Line That First Produced the Null
  • The AI Prompt That Turns a Gym Membership Contract’s Fine Print Into a Plain-English List of Cancellation Steps
  • Photoshop: Fix a Color Profile Mismatch That Makes Printed Output Look Nothing Like What You Saw On Screen
  • WordPress: Fix Search Results That Return Pages From a Theme You Deactivated Months Ago
  • Visual Studio: Fix a Test Project That Builds Fine Alone but Fails to Discover Any Tests After a NuGet Restore
  • ASP.NET Core: Fix a File Upload That Times Out on Slow Connections Only Because Kestrel’s Minimum Data Rate Feature Kicked In
  • JavaScript: Fix an Array Destructuring Default Value That Silently Never Applies Because null Was Passed Instead of Undefined

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (973)
  • How to make theater mode the default for Youtube (952)
  • How to add default value for Entity Framework migrations for DateTime and Bool (939)
  • Get the First and Last Word from a String or Sentence in SQL (847)
  • How to select distinct rows in a datatable in C# (837)

Recent Posts

  • CSS: Fix a prefers-color-scheme Media Query That Gets Silently Overridden by a Browser Extension’s Forced Dark Mode
  • Git: Fix a Merge Commit That Silently Drops a File Because Both Branches Deleted It Differently
  • HTML5: Fix a Native Lazy-Loading Image That Never Loads Because It Sits Inside a Hidden Tab Until the User Clicks It
  • The AI Prompt That Traces a Null Reference Exception Back to the Exact Line That First Produced the Null
  • The AI Prompt That Turns a Gym Membership Contract’s Fine Print Into a Plain-English List of Cancellation Steps

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com