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

Git

Git: Use Git Merge to Combine Branches

- 21.06.26 - ErcanOPAK comment on Git: Use Git Merge to Combine Branches

πŸ”€ Merge = Combine Changes Branches diverge. git merge brings them together. Feature branch to main, bug fixes to release. Essential for collaboration. πŸ“ Basic Merge # Switch to target branch git checkout main # Update main (pull latest) git pull origin main # Merge feature branch git merge feature-branch # Resolve conflicts (if any) […]

Read More
Ajax

Ajax: Read Response Headers from Fetch

- 21.06.26 - ErcanOPAK comment on Ajax: Read Response Headers from Fetch

πŸ“‹ Headers Contain Metadata Server sends headers with response. Read response headers for content type, cache, rate limits, authentication. πŸ“ Reading Headers fetch(‘/api/data’) .then(response => { // Read specific header const contentType = response.headers.get(‘Content-Type’); const cacheControl = response.headers.get(‘Cache-Control’); const rateLimit = response.headers.get(‘X-RateLimit-Remaining’); console.log(‘Content-Type:’, contentType); console.log(‘Rate limit remaining:’, rateLimit); // Check if header exists if (response.headers.has(‘X-Custom-Header’)) […]

Read More
JavaScript

JavaScript: Understand the Event Loop for Async Programming

- 21.06.26 - ErcanOPAK comment on JavaScript: Understand the Event Loop for Async Programming

πŸ”„ Event Loop = How JavaScript Runs Async JavaScript is single-threaded. Event Loop handles async operations. Understanding it explains setTimeout, callbacks, promises. πŸ“ How Event Loop Works // 1. Call Stack (synchronous code) console.log(‘1’); // Stack // 2. Web APIs (async operations) setTimeout(() => { console.log(‘2’); // Callback queue }, 1000); // 3. Callback Queue […]

Read More
HTML

HTML: Use Semantic Elements for SEO and Accessibility

- 21.06.26 - ErcanOPAK comment on HTML: Use Semantic Elements for SEO and Accessibility

πŸ“ Meaningful HTML = Better SEO Divs are meaningless. Semantic elements describe content. Search engines understand, screen readers navigate. ❌ Div Soup <div class=”header”> <div class=”nav”>…</div> </div> <div class=”main”> <div class=”content”>…</div> </div> βœ… Semantic HTML <header> <nav>…</nav> </header> <main> <article>…</article> </main> 🎯 Semantic Elements <header>: Page or section header <nav>: Navigation links <main>: Main content […]

Read More
CSS

CSS: Use Pseudo Classes for Interactive UI

- 21.06.26 - ErcanOPAK comment on CSS: Use Pseudo Classes for Interactive UI

πŸ–±οΈ :hover, :active, :focus = Interactive Feedback Static UI is boring. Pseudo classes add interactivity. Hover, click, focus β€” responsive UI. πŸ“ Common Pseudo Classes /* Hover (mouse over) */ .button:hover { background: #2980b9; transform: scale(1.05); } /* Active (clicked) */ .button:active { transform: scale(0.95); } /* Focus (tabbed or clicked input) */ input:focus { […]

Read More
Windows

Windows 11: Pause Windows Updates During Critical Work

- 21.06.26 - ErcanOPAK comment on Windows 11: Pause Windows Updates During Critical Work

⏸️ Updates Can Wait Windows updates restart your PC unexpectedly. Pause updates during critical work. Resume when convenient. πŸ”§ Pause Updates Settings β†’ Windows Update β†’ Pause updates Options: – Pause for 1 week (default) – Pause for up to 5 weeks Resume: – Click “Resume updates” Check for updates manually: – Click “Check for […]

Read More
AI

AI Prompt: Generate Compelling Product Descriptions

- 21.06.26 - ErcanOPAK comment on AI Prompt: Generate Compelling Product Descriptions

πŸ“ Sell More with Better Product Descriptions Product descriptions sell products. AI generates descriptions that persuade. Features, benefits, calls to action. πŸ“ The Prompt Generate a product description for: Product name: [Name] Category: [Electronics / Clothing / Software / etc.] Key features: – [Feature 1] – [Feature 2] – [Feature 3] Target audience: [e.g., Professionals, […]

Read More
Docker

Docker: Use Docker Compose Networking for Multi-Container Apps

- 21.06.26 - ErcanOPAK comment on Docker: Use Docker Compose Networking for Multi-Container Apps

🌐 Containers Talk to Each Other Multiple containers need to communicate. Docker Compose networking makes it easy. Use service names as hostnames. πŸ“ Docker Compose Networking version: ‘3.8’ services: web: build: . ports: – “8080:8080” environment: – DB_HOST=postgres – REDIS_HOST=redis postgres: image: postgres:15 environment: POSTGRES_PASSWORD: secret redis: image: redis:alpine # Inside web container: # ping […]

Read More
Kubernetes

Kubernetes: Use Node Affinity to Control Pod Placement

- 21.06.26 - ErcanOPAK comment on Kubernetes: Use Node Affinity to Control Pod Placement

🎯 Put Pods Where They Belong Some nodes have GPUs. Some are in different zones. Node affinity schedules pods on specific nodes. Control placement precisely. πŸ“ Node Affinity apiVersion: v1 kind: Pod metadata: name: gpu-pod spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: – matchExpressions: – key: gpu operator: In values: – “nvidia” – “amd” containers: – name: […]

Read More
Wordpress

WordPress: Understand Categories vs Tags for Content Organization

- 21.06.26 - ErcanOPAK comment on WordPress: Understand Categories vs Tags for Content Organization

πŸ“‚ Categories = Broad. Tags = Specific. Categories group content. Tags describe content. Know the difference for better SEO and organization. πŸ“ Categories Categories: – Hierarchical (parent/child) – Required (at least one default category) – Broad topics – Used for navigation menus – SEO: Category pages Examples: – Technology – Programming – JavaScript – Python […]

Read More
Photoshop

Photoshop: Use Custom Shapes for Vector Graphics

- 21.06.26 - ErcanOPAK comment on Photoshop: Use Custom Shapes for Vector Graphics

πŸ”Ά Create and Use Vector Shapes Basic shapes are limited. Custom shapes are scalable, editable, reusable. Hearts, arrows, logos β€” any vector graphic. πŸ“ Creating Custom Shapes 1. Draw shape with Pen Tool (P) 2. Select shape layer 3. Edit β†’ Define Custom Shape 4. Name the shape 5. Click OK Shape appears in Custom […]

Read More
Visual Studio

Visual Studio: Use Diagnostic Tools to Profile Performance

- 21.06.26 - ErcanOPAK comment on Visual Studio: Use Diagnostic Tools to Profile Performance

⚑ Find Performance Bottlenecks Slow code? Memory leaks? Diagnostic Tools show CPU usage, memory allocation, execution time. Find bottlenecks, optimize. πŸ”§ Using Diagnostic Tools Debug β†’ Windows β†’ Show Diagnostic Tools (Ctrl + Alt + F2) During debugging: – CPU Usage: See which methods consume most CPU – Memory Usage: Track allocations and GC – […]

Read More
C#

C#: Use Polymorphism to Write Flexible Code

- 21.06.26 - ErcanOPAK comment on C#: Use Polymorphism to Write Flexible Code

πŸ”€ Same Method, Different Behavior Polymorphism lets objects behave differently. Virtual and override enable dynamic behavior. Loose coupling, extensible. πŸ“ Polymorphism Example public class Shape { public virtual string GetName() => “Shape”; public virtual double GetArea() => 0; } public class Circle : Shape { public double Radius { get; set; } public override string […]

Read More
C#

C#: Use Abstract Classes for Shared Behavior

- 21.06.26 - ErcanOPAK comment on C#: Use Abstract Classes for Shared Behavior

πŸ“¦ Abstract Classes = Partial Implementation Interfaces define contracts. Abstract classes provide partial implementation. Reuse code, enforce patterns. πŸ“ Abstract Class Example public abstract class Animal { public string Name { get; set; } // Abstract method (must be implemented) public abstract void MakeSound(); // Virtual method (can be overridden) public virtual void Eat() { […]

Read More
SQL

SQL: Use UPDATE to Modify Existing Data

- 21.06.26 - ErcanOPAK comment on SQL: Use UPDATE to Modify Existing Data

✏️ UPDATE = Change Existing Data Data changes over time. UPDATE modifies existing rows. Be careful β€” without WHERE, updates all rows. πŸ“ Basic UPDATE — Update single column UPDATE users SET email = ‘newemail@example.com’ WHERE id = 123; — Update multiple columns UPDATE users SET name = ‘Alice Updated’, age = 31 WHERE id […]

Read More
Asp.Net Core

.NET Core: Understand Routing for URL Mapping

- 21.06.26 - ErcanOPAK comment on .NET Core: Understand Routing for URL Mapping

πŸ—ΊοΈ Routing Maps URLs to Controllers URLs need to go somewhere. Routing maps /api/users to UsersController. Clean, organized, discoverable. πŸ“ Attribute Routing [ApiController] [Route(“api/[controller]”)] public class UsersController : ControllerBase { [HttpGet] public IActionResult GetUsers() { } [HttpGet(“{id}”)] public IActionResult GetUser(int id) { } [HttpPost] public IActionResult CreateUser(User user) { } [HttpPut(“{id}”)] public IActionResult UpdateUser(int id, […]

Read More
Git

Git: Use Git Status to See What’s Changed

- 21.06.26 - ErcanOPAK comment on Git: Use Git Status to See What’s Changed

πŸ“‹ git status = What’s Happening? Forgot what you changed? git status shows everything. Modified files, staged files, untracked files. Essential command. πŸ“ Git Status Output git status # Output: On branch main Your branch is up to date with ‘origin/main’. Changes to be committed: (use “git restore –staged ” to unstage) new file: new-file.txt […]

Read More
Ajax

Ajax: Use JSON.parse to Parse Server Responses

- 21.06.26 - ErcanOPAK comment on Ajax: Use JSON.parse to Parse Server Responses

πŸ“¦ Server Returns JSON String. Parse to Object. API responses are JSON strings. JSON.parse converts to JavaScript object. Access properties easily. ❌ Without Parse const response = ‘{“name”:”Alice”}’; console.log(response.name); // undefined βœ… With Parse const data = JSON.parse(response); console.log(data.name); // ‘Alice’ 🎯 Fetch + JSON.parse // Fetch already parses with .json() fetch(‘/api/users’) .then(response => response.json()) […]

Read More
JavaScript

JavaScript: Use Strict Mode for Safer Code

- 21.06.26 - ErcanOPAK comment on JavaScript: Use Strict Mode for Safer Code

πŸ”’ Strict Mode = Fewer Bugs JavaScript has quirks. Strict mode prevents common mistakes. Safer code, fewer bugs, better performance. πŸ“ Enabling Strict Mode // Global strict mode ‘use strict’; // Function-level strict mode function myFunction() { ‘use strict’; // Strict code here } // In modules (strict by default) export default function() { // […]

Read More
HTML

HTML: Use Meta Description for SEO and Click-Through Rate

- 21.06.26 - ErcanOPAK comment on HTML: Use Meta Description for SEO and Click-Through Rate

πŸ“ Meta Description = Search Result Snippet Google shows meta description in results. Good description increases click-through rate. Include keywords, call to action. πŸ“ Basic Meta Description <head> <meta name=”description” content=”Learn how to bake sourdough bread at home. Step-by-step guide with tips for perfect crust and crumb. Start today!” “> </head> // Shows in Google […]

Read More
CSS

CSS: Understand Float for Legacy Layouts

- 21.06.26 - ErcanOPAK comment on CSS: Understand Float for Legacy Layouts

🌊 Float was Used for Layouts Before Flexbox Floats are legacy. Float wraps text around images, creates multi-column layouts. Learn for legacy code maintenance. πŸ“ Float Values /* Float left/right */ img { float: left; margin-right: 10px; } /* Clear floats */ .clearfix::after { content: ”; display: table; clear: both; } /* Common layout (legacy) […]

Read More
Windows

Windows 11: Use Xbox Game Bar to Record Screen

- 21.06.26 - ErcanOPAK comment on Windows 11: Use Xbox Game Bar to Record Screen

πŸ“Ή Record Screen, No Third-Party App Need to record your screen? Xbox Game Bar is built-in. Record gameplay, tutorials, demos. No installation needed. ⌨️ Shortcuts Win + G β†’ Open Xbox Game Bar Win + Alt + R β†’ Start/Stop recording Win + Alt + G β†’ Record last 30 seconds (game clip) Win + […]

Read More
AI

AI Prompt: Generate Attention-Grabbing Blog Post Titles

- 21.06.26 - ErcanOPAK comment on AI Prompt: Generate Attention-Grabbing Blog Post Titles

πŸ“ 80% of People Read Headlines, 20% Read Rest Bad title = nobody reads. AI generates blog titles that get clicks. Multiple styles, tested formulas. πŸ“ The Prompt Generate 20 blog post titles for: Topic: [e.g., CSS Container Queries] Target audience: [e.g., Frontend Developers] Tone: [Professional / Casual / Educational / Controversial] Keywords to include: […]

Read More
Docker

Docker: Use Docker System to Clean Up Unused Resources

- 21.06.26 - ErcanOPAK comment on Docker: Use Docker System to Clean Up Unused Resources

πŸ—‘οΈ Docker Eats Disk Space Unused images, containers, volumes fill disk. docker system prune cleans everything. Reclaim disk space. πŸ“ Prune Commands # Clean everything docker system prune -a –volumes # Clean containers docker container prune # Clean images docker image prune -a # Clean volumes docker volume prune # Clean networks docker network prune […]

Read More
Kubernetes

Kubernetes: Extend Kubernetes with Custom Resource Definitions

- 21.06.26 - ErcanOPAK comment on Kubernetes: Extend Kubernetes with Custom Resource Definitions

πŸ”Œ Define Your Own Kubernetes Objects Kubernetes has Pods, Services, Deployments. Custom Resource Definitions (CRD) create your own objects. Extend Kubernetes for your needs. πŸ“ Create a CRD apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: databases.myapp.com spec: group: myapp.com versions: – name: v1 served: true storage: true schema: openAPIV3Schema: type: object properties: spec: type: object properties: […]

Read More
Wordpress

WordPress: Configure Custom Permalinks for SEO

- 21.06.26 - ErcanOPAK comment on WordPress: Configure Custom Permalinks for SEO

πŸ”— Clean URLs = Better SEO ?p=123 is ugly. Custom permalinks create clean URLs. /my-awesome-post is better for SEO, user-friendly, shareable. πŸ“ Permalink Settings Settings β†’ Permalinks Common settings: – Plain: ?p=123 (worst for SEO) – Day and name: /2024/01/15/sample-post/ – Month and name: /2024/01/sample-post/ – Numeric: /archives/123 – Post name: /sample-post/ (best) Recommended: Post […]

Read More
Photoshop

Photoshop: Use Auto-Align Layers for Perfect Panoramas

- 21.06.26 - ErcanOPAK comment on Photoshop: Use Auto-Align Layers for Perfect Panoramas

πŸ–ΌοΈ Stitch Multiple Photos into One Manual alignment is painful. Auto-Align Layers automatically aligns overlapping photos. Perfect for panoramas, composites. πŸ“ How to Use 1. Open multiple photos 2. Select all layers 3. Edit β†’ Auto-Align Layers Options: – Auto: Best for most cases – Perspective: Straight lines – Cylindrical: Wide panoramas – Spherical: 360Β° […]

Read More
Visual Studio

Visual Studio: Configure Exception Settings to Break on Specific Errors

- 21.06.26 - ErcanOPAK comment on Visual Studio: Configure Exception Settings to Break on Specific Errors

πŸ” Break Only When You Want To Debugger breaks on all exceptions. Annoying. Exception Settings break only on specific exceptions. Focus on what matters. πŸ”§ Exception Settings Debug β†’ Windows β†’ Exception Settings (Ctrl + Alt + E) Options: – Break when thrown (check box) – Break on user-unhandled only (default) Common exceptions to break […]

Read More
C#

C#: Use Enum for Named Constants

- 21.06.26 - ErcanOPAK comment on C#: Use Enum for Named Constants

πŸ“‹ Enum = Set of Named Constants Magic numbers are bad. Enums give names to numbers. Readable code, type safety, IntelliSense. ❌ Magic Numbers if (status == 1) { } // What is 1? if (role == 2) { } // What is 2? βœ… Enum if (status == OrderStatus.Pending) { } if (role == […]

Read More
C#

C#: Use StringBuilder for Efficient String Concatenation

- 21.06.26 - ErcanOPAK comment on C#: Use StringBuilder for Efficient String Concatenation

πŸ“ String += Creates New Strings Every Time Strings are immutable. StringBuilder is mutable. Faster concatenation, less memory. Essential for loops. ❌ String Concatenation (Slow) string result = ” “; for (int i = 0; i < 10000; i++) { result += i.ToString(); // New string each time! } βœ… StringBuilder (Fast) var sb = […]

Read More
Page 14 of 97
Β« Previous 1 … 9 10 11 12 13 14 15 16 17 18 19 … 97 Next Β»

Posts pagination

« Previous 1 … 12 13 14 15 16 … 97 Next »
July 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Jun    

Most Viewed Posts

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

Recent Posts

  • C#: Use Using Statements for Resource Management
  • C#: Use Lambda Expressions for Concise Code
  • SQL: Use GROUP BY for Data Aggregation
  • .NET Core: Master Routing for Clean URLs
  • Git: Use Reset to Undo Local Changes
  • Ajax: Use Axios for HTTP Requests
  • JavaScript: Understand Hoisting
  • HTML: Use Web Storage for Client-Side Data
  • CSS: Use Filter Effects for Visual Magic
  • Windows 11: Unlock God Mode for All Settings

Most Viewed Posts

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

Recent Posts

  • C#: Use Using Statements for Resource Management
  • C#: Use Lambda Expressions for Concise Code
  • SQL: Use GROUP BY for Data Aggregation
  • .NET Core: Master Routing for Clean URLs
  • Git: Use Reset to Undo Local Changes

Social

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