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

SQL

SQL: Advanced Query Tuning with CTEs and Recursive Logic

- 21.02.26 - ErcanOPAK comment on SQL: Advanced Query Tuning with CTEs and Recursive Logic

Common Table Expressions (CTEs) are not just for readability. They allow for Recursive Queries, essential for hierarchical data like organizational charts or folder structures.

Read More
Asp.Net Core

.NET Core: High Performance Microservices with Minimal APIs

- 21.02.26 - ErcanOPAK comment on .NET Core: High Performance Microservices with Minimal APIs

Controllers add overhead. For high-speed microservices, use Minimal APIs. They are faster, use less memory, and are perfect for serverless deployments. app.MapGet(“/order/{id}”, (int id) => new Order(id));

Read More
Asp.Net Core

.NET Core: Implementing Clean Architecture for Enterprise Apps

- 21.02.26 - ErcanOPAK comment on .NET Core: Implementing Clean Architecture for Enterprise Apps

Architecture is about separating concerns. In Clean Architecture, the Domain (Logic) is at the center, surrounded by Application, and finally Infrastructure (DB/API). This ensures your business logic doesn’t depend on whether you use SQL Server or MongoDB.

Read More
Git

Git: Mastering Worktrees to Handle Multiple Tasks Simultaneously

- 21.02.26 - ErcanOPAK comment on Git: Mastering Worktrees to Handle Multiple Tasks Simultaneously

Stop stashing! git worktree lets you have multiple branches of the same repo checked out in different folders at the same time. You can fix a bug on ‘prod’ without touching your work-in-progress on ‘dev’.

Read More
Git

Git: The Ultimate Safety Net – Recovering ‘Deleted’ Work with Reflog

- 21.02.26 - ErcanOPAK comment on Git: The Ultimate Safety Net – Recovering ‘Deleted’ Work with Reflog

Did you accidentally delete a branch? Or lose a commit during a bad rebase? git reflog is your time machine. It records every single movement of the HEAD, even those not in the history.

Read More
Ajax

Ajax: Canceling Outdated Requests with AbortController

- 21.02.26 - ErcanOPAK comment on Ajax: Canceling Outdated Requests with AbortController

Don’t waste bandwidth. If a user clicks a button 10 times, you should abort the previous 9 requests using AbortController. const controller = new AbortController(); fetch(url, { signal: controller.signal }); // Later… controller.abort();

Read More
JavaScript

JavaScript: Demystifying the Event Loop and Microtask Queue

- 21.02.26 - ErcanOPAK comment on JavaScript: Demystifying the Event Loop and Microtask Queue

Understanding the difference between setTimeout (Macrotask) and Promise.then (Microtask) is what separates junior and senior JS developers. Execution Order: 1. Synchronous Code 2. All Microtasks (Promises) 3. Render UI 4. Macrotasks (Timers)

Read More
HTML

HTML5: Encapsulating Styles with Shadow DOM and Web Components

- 21.02.26 - ErcanOPAK comment on HTML5: Encapsulating Styles with Shadow DOM and Web Components

Avoid ‘CSS Bleeding’. Shadow DOM allows you to attach a hidden, separate DOM to an element, ensuring its styles don’t leak out and affect the rest of the page. Ideal for: Design systems, widgets, and reusable library components.

Read More
CSS

CSS: The End of Media Queries? Welcome to Container Queries

- 21.02.26 - ErcanOPAK comment on CSS: The End of Media Queries? Welcome to Container Queries

For decades, we designed based on the viewport. But components should be responsive based on their container. .card-container { container-type: inline-size; } @container (min-width: 400px) { .card { display: flex; } } This allows a component to look different depending on whether it’s in a narrow sidebar or a wide main content area. A total […]

Read More
Windows

Windows 11: Professional UI Tweaks via Registry for Power Users

- 21.02.26 - ErcanOPAK comment on Windows 11: Professional UI Tweaks via Registry for Power Users

Want the classic Context Menu back? Or want to disable the ‘Web Search’ in the Start Menu? You don’t need 3rd party apps; just a few registry keys. Warning: Always backup your registry before editing. This post details 5 essential registry paths to make Windows 11 feel like a pro workstation instead of a consumer […]

Read More
Windows

Windows 11: Transforming the Desktop Experience with ‘Dev Home’

- 21.02.26 - ErcanOPAK comment on Windows 11: Transforming the Desktop Experience with ‘Dev Home’

Microsoft finally released Dev Home, a control center specifically for developers. It centralizes your GitHub repos, system monitors (CPU/GPU/RAM), and Azure tasks in one dashboard. Combined with the new Dev Drive (ReFS-based), it increases build speeds by up to 30% by bypassing heavy file system security checks on trusted code folders.

Read More
AI

AI Prompt: Crafting a Viral Technical Newsletter in Seconds

- 21.02.26 - ErcanOPAK comment on AI Prompt: Crafting a Viral Technical Newsletter in Seconds

Create content that people actually read. Use this structure for your technical newsletter prompt: “Act as a Senior Tech Editor. Create a newsletter for developers about [Topic]. 1. Hook the reader with a shocking statistic. 2. Explain a complex concept using a simple analogy. 3. Curate 3 high-value links. 4. End with a provocative question […]

Read More
AI

AI: Optimizing Large Context Windows for Massive Codebases

- 21.02.26 - ErcanOPAK comment on AI: Optimizing Large Context Windows for Massive Codebases

Modern LLMs now support massive context windows (128k+ tokens). But more data isn’t always better. You must manage the ‘Lost in the Middle’ phenomenon. Professional Tip: Place your most critical instructions at the very beginning or the very end of the prompt. AI models tend to pay less attention to the middle of long inputs.

Read More
AI

AI Prompt Engineering: The ‘Chain of Thought’ Technique for Complex Tasks

- 21.02.26 - ErcanOPAK comment on AI Prompt Engineering: The ‘Chain of Thought’ Technique for Complex Tasks

If you ask AI for a complex solution directly, it may hallucinate. Forcing it to use Chain of Thought (CoT) increases accuracy by 40%. The Strategy: Add this to your prompt: “Let’s think step-by-step. First, define the problem. Second, analyze the constraints. Third, propose 3 options. Finally, select the best one and write the code.”

Read More
Docker

Docker: Enhancing Security with Rootless Containers

- 21.02.26 - ErcanOPAK comment on Docker: Enhancing Security with Rootless Containers

Running Docker as ‘root’ is a significant security risk. If a container is compromised, the attacker has root access to the host. Rootless Mode mitigates this risk. “Security isn’t about one big wall; it’s about layers of protection. Rootless Docker is a crucial layer.” Rootless mode allows running the Docker daemon and containers as a […]

Read More
Kubernetes

Kubernetes: Implementing a GitOps Workflow with ArgoCD

- 21.02.26 | 22.02.26 - ErcanOPAK comment on Kubernetes: Implementing a GitOps Workflow with ArgoCD

In a professional DevOps environment, the Git repository is the Single Source of Truth. Manual kubectl apply commands are replaced by ArgoCD. Git Push โ†’ CI Build โ†’ Manifest Update โ†’ ArgoCD Sync โ†’ K8s Cluster This ensures that your cluster state always matches your code, enabling instant rollbacks and better security audits.

Read More
Wordpress

WordPress: Boosting API Performance with the Transients API

- 21.02.26 - ErcanOPAK comment on WordPress: Boosting API Performance with the Transients API

Fetching data from external APIs on every page load is a performance killer. The Transients API allows you to cache that data in the WP database for a specific period. // Store data for 12 hours set_transient(‘external_data_cache’, $api_data, 12 * HOUR_IN_SECONDS); This simple trick can reduce server-side execution time from seconds to milliseconds for data-heavy […]

Read More
Wordpress

WordPress: Transitioning to a Headless CMS with WP-GraphQL

- 21.02.26 - ErcanOPAK comment on WordPress: Transitioning to a Headless CMS with WP-GraphQL

Why settle for a traditional monolith? Many modern enterprises use WordPress as a Headless CMS, serving data to a Next.js or React frontend via GraphQL. query GetPosts { posts { nodes { title excerpt featuredImage { node { sourceUrl } } } } } This approach combines the world-class content management of WordPress with the […]

Read More
Photoshop

Photoshop: High-End Skin Retouching with Advanced Frequency Separation

- 21.02.26 - ErcanOPAK comment on Photoshop: High-End Skin Retouching with Advanced Frequency Separation

The goal of professional retouching is to remove imperfections while keeping the skin 100% natural. This is where Frequency Separation becomes vital. Technical Breakdown: 1. Low Frequency: Handles colors and tones (Gaussian Blur). 2. High Frequency: Handles texture and pores (High Pass/Linear Light). By splitting these, you can smooth out blotchy skin on the Low […]

Read More
Photoshop

Photoshop: Advanced Color Theory for Professional Photo Manipulation

- 21.02.26 - ErcanOPAK comment on Photoshop: Advanced Color Theory for Professional Photo Manipulation

Professional retouching isn’t about the tools; it’s about Color Theory. Understanding how complementary colors create visual tension is key to high-end design. Harmony Type Effect Complementary High contrast, energetic feel. Analogous Calm, serene, and professional. Triadic Balanced but vibrant diversity. The Pro Hack: Use the Color Balance adjustment layer with a Luminosity Mask. Target only […]

Read More
Visual Studio

Visual Studio 2022: Revolutionary Webhook Debugging with Dev Tunnels

- 21.02.26 - ErcanOPAK comment on Visual Studio 2022: Revolutionary Webhook Debugging with Dev Tunnels

๐Ÿ“Œ Executive Summary Developing webhooks or mobile backends usually requires complex tools like Ngrok. Visual Studio’s Dev Tunnels feature changes everything by providing a built-in, secure public URL for your localhost. The Technical Workflow Dev Tunnels create a secure relay between the internet and your local machine. This is critical for testing Stripe webhooks, GitHub […]

Read More
C#

C#: Don’t Guess, Measure with BenchmarkDotNet

- 21.02.26 - ErcanOPAK comment on C#: Don’t Guess, Measure with BenchmarkDotNet

Think StringBuilder is always faster? Measure it. BenchmarkDotNet is the gold standard for performance testing in the .NET ecosystem.

Read More
C#

C#: Clean Your Files with Global Usings and File-Scoped Namespaces

- 21.02.26 - ErcanOPAK comment on C#: Clean Your Files with Global Usings and File-Scoped Namespaces

Stop wasting the first 20 lines of every file on using statements. Create a GlobalUsings.cs file! global using System.Collections.Generic; global using Microsoft.Extensions.Logging;

Read More
C#

C#: Master System.Threading.Channels for Producer-Consumer Patterns

- 21.02.26 - ErcanOPAK comment on C#: Master System.Threading.Channels for Producer-Consumer Patterns

When you have a fast data producer and a slow consumer, use Channels. It’s much faster and thread-safe than using ConcurrentQueue with locks.

Read More
SQL

SQL: Fixing Slow Queries with Index Rebuilding

- 21.02.26 - ErcanOPAK comment on SQL: Fixing Slow Queries with Index Rebuilding

If your database is slow despite having indexes, they might be fragmented. Check fragmentation with sys.dm_db_index_physical_stats. The Fix: ALTER INDEX ALL ON MyTable REBUILD;

Read More
SQL

SQL Server: Querying JSON Columns Like a Pro

- 21.02.26 - ErcanOPAK comment on SQL Server: Querying JSON Columns Like a Pro

Modern SQL Server can handle NoSQL-style JSON data. Stop serializing/deserializing in C#; do it in SQL! SELECT JSON_VALUE(LogData, ‘$.Browser’) as Browser FROM WebLogs WHERE JSON_VALUE(LogData, ‘$.Status’) = ‘Error’

Read More
Asp.Net Core

.NET Core: Instant Real-time Updates with SignalR

- 21.02.26 - ErcanOPAK comment on .NET Core: Instant Real-time Updates with SignalR

Don’t make your users refresh the page. SignalR handles WebSockets, Server-Sent Events, and Long Polling automatically. await Clients.All.SendAsync(“ReceiveMessage”, “New Order Received!”);

Read More
Asp.Net Core

.NET Core: Structured Logging with Serilog and Seq

- 21.02.26 - ErcanOPAK comment on .NET Core: Structured Logging with Serilog and Seq

Flat text logs are useless in production. Use Structured Logging to search your logs like a database. Log.Information(“User {UserId} logged in from {Ip}”, user.Id, ip); This allows you to filter logs by ‘UserId’ instantly, making bug tracking a breeze.

Read More
Git

Git: Managing Multiple GitHub Accounts with SSH Config

- 21.02.26 - ErcanOPAK comment on Git: Managing Multiple GitHub Accounts with SSH Config

Stop using HTTPS and typing passwords. Use an ~/.ssh/config file to manage work and personal Git accounts seamlessly on one machine.

Read More
Git

Git: Cleaning Up Your Commit Mess with ‘Interactive Rebase’

- 21.02.26 - ErcanOPAK comment on Git: Cleaning Up Your Commit Mess with ‘Interactive Rebase’

Professionals never push ‘fix typo’ commits. They clean their history first. git rebase -i HEAD~5 This opens an editor where you can squash multiple commits into one clean, professional summary. Your senior dev will love you.

Read More
Page 12 of 69
ยซ Previous 1 … 7 8 9 10 11 12 13 14 15 16 17 … 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 (859)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • 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 (448)

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 (859)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • 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