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

Author: ErcanOPAK

AI

AI Prompt: The ‘Master Repairman’ for Household Disasters

- 28.02.26 - ErcanOPAK comment on AI Prompt: The ‘Master Repairman’ for Household Disasters

Got a leaking faucet or a dishwasher error? Use AI to save hundreds on repair costs. The Prompt: “Act as a Senior Appliance Technician with 30 years of experience. My [Brand/Model] is showing error [Code/Symptom]. 1. Explain the most likely cause. 2. Provide a step-by-step DIY fix guide. 3. List the tools needed. 4. Give […]

Read More
AI

AI Prompt: Creating Perfect OpenAPI (Swagger) Documentation

- 28.02.26 - ErcanOPAK comment on AI Prompt: Creating Perfect OpenAPI (Swagger) Documentation

Stop writing YAML manually. Let AI design your API contract. “Act as an API Architect. I need to build a service for [Feature – e.g., Car Rental]. Generate a full OpenAPI 3.0 specification in YAML. Include request/response schemas, error codes (400, 401, 500), and example JSON payloads for each endpoint.”

Read More
AI

AI Prompt: Transforming Spaghetti Code into Clean Architecture

- 28.02.26 - ErcanOPAK comment on AI Prompt: Transforming Spaghetti Code into Clean Architecture

Use this prompt to modernize old codebases instantly. The Prompt: “Act as a Staff Software Engineer. Analyze the following code: [Paste Code]. 1. Identify code smells (DRY, SOLID). 2. Refactor it to use modern [Language] features. 3. Implement the Repository Pattern. 4. Provide the result in a clean, documented format.”

Read More
Docker

Docker: Reclaiming GBs of Space with One Command

- 28.02.26 - ErcanOPAK comment on Docker: Reclaiming GBs of Space with One Command

Docker builds create ‘Dangling Images’—layers that are no longer used but take up massive disk space. The Magic Command: docker system prune -a –volumes This removes all unused containers, networks, and images. It’s the digital equivalent of power-washing your development environment.

Read More
Kubernetes

Kubernetes: Avoiding the ‘OOMKilled’ Error with Proper Resource Limits

- 28.02.26 - ErcanOPAK comment on Kubernetes: Avoiding the ‘OOMKilled’ Error with Proper Resource Limits

One of the most common K8s failures is the Out of Memory (OOM) Killer. This happens when your container exceeds its allocated limit. Type Definition Requests What the pod is guaranteed to have. Limits The absolute maximum the pod can consume. Pro Strategy: Always set requests equal to limits for memory to avoid unstable rescheduling […]

Read More
Wordpress

WordPress: Protect Your Site from Brute Force by Disabling XML-RPC

- 28.02.26 - ErcanOPAK comment on WordPress: Protect Your Site from Brute Force by Disabling XML-RPC

XML-RPC is an old API used for remote access. Today, it’s mostly a target for hackers to try thousands of password combinations in a single request. How to Disable: Paste this into your .htaccess file: Order Deny,Allow Deny from all This simple block reduces server load and significantly hardens your security wall.

Read More
Wordpress

WordPress: Instant Speed Boost by Limiting Post Revisions

- 28.02.26 - ErcanOPAK comment on WordPress: Instant Speed Boost by Limiting Post Revisions

By default, WordPress saves every single edit as a revision. For a 500-post blog, your database could be bloated with 5000+ unnecessary rows, slowing down SQL queries. The Solution: Add this line to your wp-config.php to keep only the last 3 versions: define(‘WP_POST_REVISIONS’, 3); This keeps your wp_posts table lean and your server response times […]

Read More
Photoshop

Photoshop: Fixing ‘Clipped’ Composition with Generative Expand

- 28.02.26 - ErcanOPAK comment on Photoshop: Fixing ‘Clipped’ Composition with Generative Expand

You have a great photo but the subject is too close to the edge? Don’t crop; expand. The Pro Move: Use the Crop Tool and drag beyond the image boundaries. In the Contextual Task Bar, select ‘Generative Expand’. Leave the prompt empty. AI analyzes the texture, lighting, and shadows of the original image to create […]

Read More
Photoshop

Photoshop: The ‘Secret’ to Infinite Re-editing with Smart Camera Raw

- 28.02.26 - ErcanOPAK comment on Photoshop: The ‘Secret’ to Infinite Re-editing with Smart Camera Raw

Most designers apply Camera Raw filters directly, losing the ability to tweak later. The professional way is to use Smart Objects. Step-by-Step: 1. Right-click your layer -> Convert to Smart Object. 2. Filter -> Camera Raw Filter. 3. Now, you can double-click the filter in the layers panel anytime to change settings! Result: You maintain […]

Read More
Visual Studio

Visual Studio: Automating Frontend Assets with Built-in Task Runner Explorer

- 28.02.26 - ErcanOPAK comment on Visual Studio: Automating Frontend Assets with Built-in Task Runner Explorer

The Problem: Manually running Gulp, Grunt, or Npm scripts every time you build or open a project is a productivity killer. Visual Studio’s Task Runner Explorer allows you to bind specific scripts to IDE events like ‘Project Open’ or ‘Before Build’. Why this is a Life Saver: Consistency: Ensures every developer on the team runs […]

Read More
C#

C# Async/Await: The Deadlock Pattern That Haunts Every Senior Developer

- 23.02.26 | 23.02.26 - ErcanOPAK comment on C# Async/Await: The Deadlock Pattern That Haunts Every Senior Developer

☠️ The Silent Killer: Application.Hang System.Threading.Tasks.Task Status: WaitingForActivation No exceptions thrown No error logs Just… frozen forever Welcome to the deadlock nightmare. It’s 3 AM. Your app is frozen. Users are screaming. And you have NO IDEA where the problem is. The Classic Deadlock Pattern ☠️ DEADLOCK CODE (Don’t Copy This!) // The code that […]

Read More
C#

C# LINQ: The Performance Traps That Cost Us 90% Speed (And How to Fix Them)

- 23.02.26 | 23.02.26 - ErcanOPAK comment on C# LINQ: The Performance Traps That Cost Us 90% Speed (And How to Fix Them)

🐌 The LINQ That Killed Performance Beautifully expressive LINQ. Slow as molasses. Your elegant code processes 1000 items in 8 seconds. Production is on fire. The 3 Deadly LINQ Mistakes 💣 Mistake #1: Multiple Enumeration ❌ SLOW (database hit 3 times!) var query = dbContext.Users.Where(u => u.IsActive); var count = query.Count(); // DB hit #1 […]

Read More
SQL

SQL Query Optimization: The 5 Tricks That Saved Our Database from Collapse

- 23.02.26 | 23.02.26 - ErcanOPAK comment on SQL Query Optimization: The 5 Tricks That Saved Our Database from Collapse

💥 The Database Meltdown 9 AM Monday. Database CPU: 98%. Queries timing out. Users can’t log in. Boss is screaming. You have 1 hour to fix it before the CEO finds out. The 5 Performance Killers (And How to Fix Them) 💣 Killer #1: SELECT * ❌ SLOW (transfers 50 columns, 10MB) SELECT * FROM […]

Read More
Asp.Net Core

.NET Core Background Services: Running Tasks Without Blocking Your API

- 23.02.26 | 23.02.26 - ErcanOPAK comment on .NET Core Background Services: Running Tasks Without Blocking Your API

⏰ The Slow Endpoint Problem User uploads 100MB file. Your API processes it… for 45 seconds. Request times out. User refreshes. Uploads again. Your server? On fire. 🔥 Background Services: The Fire-and-Forget Pattern ❌ Blocking the Request (Bad) [HttpPost(“upload”)] public async Task Upload(IFormFile file) { // Save file await SaveFileAsync(file); // 2 seconds // Generate […]

Read More
Asp.Net Core

.NET Core Middleware: Building a Production-Grade Request Pipeline

- 23.02.26 | 23.02.26 - ErcanOPAK comment on .NET Core Middleware: Building a Production-Grade Request Pipeline

🔗 The Request Pipeline Mystery Your API is slow. Users complain. You add logging… but where? You need auth checks, rate limiting, error handling. They’re scattered everywhere. Sound chaotic? Understanding the Middleware Pipeline 🎯 What Middleware Actually Does Request comes in → ├─ Logging Middleware (start timer) │ ├─ Auth Middleware (check JWT) │ │ […]

Read More
Git

Git Worktrees: Work on Multiple Branches Simultaneously Without Stashing

- 23.02.26 | 23.02.26 - ErcanOPAK comment on Git Worktrees: Work on Multiple Branches Simultaneously Without Stashing

🔀 The Context Switch Nightmare You’re deep in feature work. Urgent bug reported. You stash, switch branches, fix bug, switch back, pop stash… 20 minutes lost. Your flow? Destroyed. Git Worktrees: Multiple Working Directories, One Repo ❌ The Old Way (Painful) # Working on feature branch $ git status On branch feature/new-dashboard Changes not staged… […]

Read More
Ajax

AJAX Fetch API: The Request Interceptor Pattern That Saved Our Auth System

- 23.02.26 | 23.02.26 - ErcanOPAK comment on AJAX Fetch API: The Request Interceptor Pattern That Saved Our Auth System

🔐 The Authentication Nightmare Every API call needs an auth token. Every developer on your team copies the same 10 lines of code. Token refresh logic is duplicated 47 times across your codebase. Sound familiar? The Solution: Fetch Interceptor Pattern ❌ The Repetitive Way (47 Places) // Component A const token = localStorage.getItem(‘token’); const response […]

Read More
JavaScript

JavaScript Performance: The One Weird Trick That Made Our App 10x Faster

- 23.02.26 | 23.02.26 - ErcanOPAK comment on JavaScript Performance: The One Weird Trick That Made Our App 10x Faster

⚡ Performance.now() = Before: 8.5s | After: 0.8s PROBLEM: Rendering 10,000 items BOTTLENECK: DOM manipulation SOLUTION: Virtual scrolling / windowing RESULT: 10x faster, 90% less memory The Problem: You’re Rendering What Users Can’t See ❌ The Slow Way // Render ALL 10,000 items const list = document.getElementById(‘list’); items.forEach(item => { const div = document.createElement(‘div’); div.textContent […]

Read More
HTML

HTML5 Forms: The Built-In Validation That Replaced jQuery Validate

- 23.02.26 | 23.02.26 - ErcanOPAK comment on HTML5 Forms: The Built-In Validation That Replaced jQuery Validate

📝 The 10KB JavaScript Library You Don’t Need We used to load jQuery + jQuery Validate (45KB) just to validate emails. Now? Zero JavaScript. Native HTML does it all. The Power of Native Validation 🎯 All The Validation You Need (No JS) <form> <!– Email validation –> <input type=”email” required placeholder=”Email”> <!– URL validation –> […]

Read More
CSS

CSS Grid + Subgrid: The Layout Technique That Killed My Need for Flexbox

- 23.02.26 - ErcanOPAK comment on CSS Grid + Subgrid: The Layout Technique That Killed My Need for Flexbox

🎨 The Layout Revolution Flexbox was great. But CSS Grid + Subgrid? It’s game over. Layouts that took 200 lines of CSS now take 10. The Problem Subgrid Solves ❌ The Old Nightmare You have a card grid. Each card has a title, image, description, and button. You want all titles aligned, all images the […]

Read More
Windows

Windows 11 PowerToys: The Free Microsoft Tool That Makes You 10x More Productive

- 23.02.26 - ErcanOPAK comment on Windows 11 PowerToys: The Free Microsoft Tool That Makes You 10x More Productive

⚡ The Secret Weapon Microsoft employees use this internally. Now it’s free for everyone. Yet 95% of Windows users don’t know it exists. The 6 Game-Changing Tools 🚀 PowerToys Run (Alt + Space) What it is: Spotlight for Windows. Instant search for apps, files, calculations, even unit conversions. Type: “chrome” → Opens Chrome instantly Type: […]

Read More
AI

AI Code Review: How We Caught 37 Bugs Before Production Using GPT-4

- 23.02.26 - ErcanOPAK comment on AI Code Review: How We Caught 37 Bugs Before Production Using GPT-4

🐛 The Bug That Cost $500K A simple SQL injection bug. Missed in code review. Discovered by hackers. 500K customer records leaked. Company reputation destroyed. Could AI have caught it? Yes. The AI-Powered Code Review Workflow 🔍 The Prompt That Saves Lives You are a Senior Security Engineer and Code Reviewer with expertise in: – […]

Read More
AI

AI Prompt Engineering: The $200/Hour Technique Used by Top Consultants

- 23.02.26 - ErcanOPAK comment on AI Prompt Engineering: The $200/Hour Technique Used by Top Consultants

💰 The $50K Mistake Company hired AI consultants. Paid $50,000 for “AI integration.” Result? Prompts that anyone could write. Here’s what they should have gotten. The RICE Framework for Enterprise Prompts R – Role Assignment Bad: “Write code for…” “>Good: “You are a Senior Backend Engineer with 10 years of experience in distributed systems and […]

Read More
Docker

Docker Multi-Stage Builds: From 1.2GB to 50MB – A Production Story

- 23.02.26 | 23.02.26 - ErcanOPAK comment on Docker Multi-Stage Builds: From 1.2GB to 50MB – A Production Story

$ docker images | grep ‘before’ myapp:before 1.2GB “This is fine” 🔥 myapp:after 50MB “Wait, what?” 🤯 How we reduced our Docker image by 96% and cut deployment time from 10 minutes to 30 seconds. The Problem: Build Artifacts in Production ❌ The Bad Old Way FROM node:18 WORKDIR /app # Copy everything (including .git, […]

Read More
Kubernetes

Kubernetes Monitoring: The Prometheus + Grafana Stack That Saved Our Production

- 23.02.26 - ErcanOPAK comment on Kubernetes Monitoring: The Prometheus + Grafana Stack That Saved Our Production

🚨 The 3 AM Wake-Up Call Your Kubernetes cluster is down. Users are angry. You have no idea what happened. This is why Fortune 500 companies spend $500K/year on observability. The Complete Observability Stack 📊 The Three Pillars Metrics – What’s happening right now (Prometheus) Logs – What happened in the past (Loki) Traces – […]

Read More
Wordpress

WordPress Caching: The 4-Layer Strategy That Handles 1 Million Daily Visitors

- 23.02.26 - ErcanOPAK comment on WordPress Caching: The 4-Layer Strategy That Handles 1 Million Daily Visitors

🚀 From Crash to Cash Your site goes viral. Reddit hug of death. Server crashes. You lose $50,000 in sales. This doesn’t have to happen. The 4-Layer Caching Architecture 🌍 Layer 1: CDN (Cloudflare) What it does: Caches entire pages at edge servers worldwide Hit rate: 80-95% of requests never touch your server Cost: Free […]

Read More
Wordpress

WordPress as a Headless CMS: Why Fortune 500 Companies Are Making The Switch

- 23.02.26 - ErcanOPAK comment on WordPress as a Headless CMS: Why Fortune 500 Companies Are Making The Switch

💼 The $10 Billion Problem Traditional WordPress sites can’t handle 100,000 concurrent users. Your marketing team loves WordPress. Your engineering team hates the performance. Sound familiar? The Headless Solution: Best of Both Worlds 🎨 Content Team Gets Familiar WordPress admin Gutenberg editor they know All their favorite plugins No training needed ⚡ Dev Team Gets […]

Read More
Photoshop

Photoshop Color Grading: The Netflix Cinematographer’s Secret Technique

- 23.02.26 - ErcanOPAK comment on Photoshop Color Grading: The Netflix Cinematographer’s Secret Technique

🎬 The $1000/Hour Technique This is how cinematographers create those iconic looks you see in Stranger Things, Blade Runner 2049, and The Matrix. The Three-Layer Color Grading System 🎨 Layer 1: The Foundation (Color Balance) This is where you set the overall mood. Warm shadows? Cool highlights? This is your canvas. Shadows: Add warm (orange/red) […]

Read More
Photoshop

Photoshop 2024: How Neural Filters Are Changing Professional Retouching Forever

- 23.02.26 - ErcanOPAK comment on Photoshop 2024: How Neural Filters Are Changing Professional Retouching Forever

The AI Revolution in Photo Editing What took 3 hours of manual retouching now takes 3 minutes. Not hyperbole. Actual client work. 🎨 The Game-Changing Filters Skin Smoothing The Old Way: Frequency separation, healing brush, countless layers. The New Way: One slider. AI detects skin, smooths while keeping texture. Time Saved: 40 minutes → 2 […]

Read More
Visual Studio

Visual Studio 2022: The Hidden Power of CodeLens That 10x Developers Actually Use

- 23.02.26 - ErcanOPAK comment on Visual Studio 2022: The Hidden Power of CodeLens That 10x Developers Actually Use

🎯 The Problem Most Developers Face You’re reading code and wondering: “Who wrote this? When was it last changed? Where is it being used?” Opening Git history, searching references – it all takes precious seconds that add up to hours every week. Enter CodeLens: Your Code Intelligence Layer CodeLens displays contextual information directly above methods […]

Read More
Page 10 of 69
« Previous 1 … 5 6 7 8 9 10 11 12 13 14 15 … 69 Next »

Posts navigation

Older posts
Newer posts
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

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