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

Photoshop

Fix Over-Sharpened Text in UI Screenshots

- 28.01.26 - ErcanOPAK comment on Fix Over-Sharpened Text in UI Screenshots

Steps Filter → Blur → Gaussian Blur (0.3–0.5px) Then sharpen slightly using High Pass (0.6px) Why it mattersScreenshots often look harsh on retina displays. This restores natural readability.

Read More
Visual Studio

Solution Filters for Massive Repos

- 28.01.26 - ErcanOPAK comment on Solution Filters for Massive Repos

TipUse .slnf (Solution Filter) files to load only the projects you actually need. Why it mattersLarge solutions kill startup time. Filters reduce memory usage and speed up context switching without touching the main solution.

Read More
C#

with Expressions for Safe Mutations

- 27.01.26 - ErcanOPAK comment on with Expressions for Safe Mutations

var updated = user with { IsActive = true }; Why it mattersImmutable style without boilerplate.

Read More
C#

Guard Clauses Improve Readability

- 27.01.26 - ErcanOPAK comment on Guard Clauses Improve Readability

if (user == null) return; Why it mattersFlatter code, easier reasoning.

Read More
C#

ValueTask for Hot Paths

- 27.01.26 - ErcanOPAK comment on ValueTask for Hot Paths

ValueTask<int> GetValueAsync(); Why it mattersAvoids allocations in high-frequency calls.

Read More
SQL

Use EXISTS Instead of COUNT(*)

- 27.01.26 - ErcanOPAK comment on Use EXISTS Instead of COUNT(*)

Why it mattersStops scanning once a match is found.

Read More
SQL

Partial Indexes Save Space

- 27.01.26 - ErcanOPAK comment on Partial Indexes Save Space

CREATE INDEX idx_active_users ON Users(Id) WHERE IsActive = 1; Why it mattersIndex only what you query.

Read More
Asp.Net Core / C#

Use ProblemDetails for API Errors

- 27.01.26 - ErcanOPAK comment on Use ProblemDetails for API Errors

return Results.Problem(“Invalid input”); Why it mattersStandardized error responses = better clients.

Read More
Asp.Net Core / C#

Background Tasks with IHostedService

- 27.01.26 - ErcanOPAK comment on Background Tasks with IHostedService

public class Worker : BackgroundService { protected override Task ExecuteAsync(CancellationToken ct) => Task.CompletedTask; } Why it mattersClean background jobs without hacks.

Read More
Git

See Who Changed a Line and Why

- 27.01.26 - ErcanOPAK comment on See Who Changed a Line and Why

git blame file.cs Why it mattersContext beats guesswork.

Read More
Git

Fix Last Commit Without New History

- 27.01.26 - ErcanOPAK comment on Fix Last Commit Without New History

git commit –amend Why it mattersClean history, no noise.

Read More
Ajax / JavaScript

Throttle Requests to Save Backend

- 27.01.26 - ErcanOPAK comment on Throttle Requests to Save Backend

let timeout; input.oninput = () => { clearTimeout(timeout); timeout = setTimeout(sendRequest, 300); }; Why it mattersLess load, better UX.

Read More
JavaScript

Use AbortController to Cancel Requests

- 27.01.26 - ErcanOPAK comment on Use AbortController to Cancel Requests

const controller = new AbortController(); fetch(url, { signal: controller.signal }); controller.abort(); Why it mattersPrevents race conditions and wasted bandwidth.

Read More
HTML

details + summary for Native Toggles

- 27.01.26 - ErcanOPAK comment on details + summary for Native Toggles

<details> <summary>More info</summary> Hidden content </details> Why it mattersAccessible, interactive, no JS.

Read More
CSS

aspect-ratio Ends Padding Hacks Forever

- 27.01.26 - ErcanOPAK comment on aspect-ratio Ends Padding Hacks Forever

.video { aspect-ratio: 16 / 9; } Why it mattersCleaner layouts, zero JS.

Read More
Windows

Storage Sense Prevents Silent Disk Death

- 27.01.26 - ErcanOPAK comment on Storage Sense Prevents Silent Disk Death

Settings → Storage → Storage Sense Why it mattersAvoids “disk full” surprises mid-build.

Read More
Windows

Snap Layouts = Multitasking on Steroids

- 27.01.26 - ErcanOPAK comment on Snap Layouts = Multitasking on Steroids

Hover over maximize button → choose layout. Why it mattersPerfect window memory for coding + docs + browser.

Read More
AI

Emergency Travel Problem Solver

- 27.01.26 - ErcanOPAK comment on Emergency Travel Problem Solver

Prompt Act as a travel expert. Provide calm, step-by-step advice for unexpected travel issues using minimal resources. Why it mattersUniversal, practical, non-tech value.

Read More
AI

Explain Code Like to a Junior Developer

- 27.01.26 - ErcanOPAK comment on Explain Code Like to a Junior Developer

Prompt Explain this code step by step as if teaching a junior developer.Include why each decision was made. Why it mattersGreat for documentation and onboarding.

Read More
AI

Generate Test Cases from Business Rules

- 27.01.26 - ErcanOPAK comment on Generate Test Cases from Business Rules

Prompt Convert these business rules into edge-case-focused unit test scenarios.Prioritize boundary conditions and failure paths. Why it mattersAI becomes a QA brain, not just a coder.

Read More
Docker

Use .dockerignore Like .gitignore

- 27.01.26 - ErcanOPAK comment on Use .dockerignore Like .gitignore

node_modules bin obj .git Why it mattersSmaller build context = faster builds, fewer leaks.

Read More
Kubernetes

Use Resource Requests to Prevent Noisy Neighbors

- 27.01.26 - ErcanOPAK comment on Use Resource Requests to Prevent Noisy Neighbors

resources: requests: cpu: “250m” memory: “256Mi” Why it mattersWithout requests, Kubernetes can’t schedule intelligently → random slowdowns.

Read More
Wordpress

Custom REST Endpoint Without a Plugin

- 27.01.26 - ErcanOPAK comment on Custom REST Endpoint Without a Plugin

add_action(‘rest_api_init’, function () { register_rest_route(‘custom/v1’, ‘/ping’, [ ‘methods’ => ‘GET’, ‘callback’ => fn() => ‘pong’ ]); }); Why it mattersLightweight APIs for headless or automation use.

Read More
Wordpress

Load Plugins Only on Needed Pages

- 27.01.26 - ErcanOPAK comment on Load Plugins Only on Needed Pages

add_filter(‘option_active_plugins’, function ($plugins) { if (!is_page(‘contact’)) { $plugins = array_diff($plugins, [‘contact-form/plugin.php’]); } return $plugins; }); Why it mattersMassive performance gain without deleting plugins.

Read More
Photoshop

Turn Any Photo Into a Clean Illustration Look

- 27.01.26 - ErcanOPAK comment on Turn Any Photo Into a Clean Illustration Look

Steps: Filter → Filter Gallery → Cutout Reduce colors (3–5) Add slight Noise (1–2%) Why it mattersPerfect for blog headers and thumbnails that stand out without stock-photo vibes.

Read More
Photoshop

Fix Washed-Out Blacks for Web Images

- 27.01.26 - ErcanOPAK comment on Fix Washed-Out Blacks for Web Images

Before export: Image → Adjustments → Levels Black input: 5–8 White input: 245–250 Why it mattersScreens crush blacks. This restores contrast without over-darkening.

Read More
Visual Studio

Use Task List Comments as a Lightweight Issue Tracker

- 27.01.26 - ErcanOPAK comment on Use Task List Comments as a Lightweight Issue Tracker

// TODO: optimize cache eviction // HACK: temporary workaround for legacy API View → Task List Why it mattersYou get an in-IDE micro issue tracker without Jira friction. Perfect for solo or small teams.

Read More
C#

Records for Configuration Objects

- 26.01.26 - ErcanOPAK comment on Records for Configuration Objects

public record AppConfig(string Url, int Timeout); Why it mattersImmutable configs = fewer runtime surprises.

Read More
C#

Use Span to Avoid Allocations

- 26.01.26 - ErcanOPAK comment on Use Span to Avoid Allocations

Span<char> buffer = stackalloc char[128]; Why it mattersHigh-performance without GC pressure.

Read More
C#

Pattern Matching for Cleaner Logic

- 26.01.26 - ErcanOPAK comment on Pattern Matching for Cleaner Logic

if (obj is User { IsActive: true }) Why it mattersReadable, safe, expressive code.

Read More
Page 28 of 69
« Previous 1 … 23 24 25 26 27 28 29 30 31 32 33 … 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