π 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) […]
Author: ErcanOPAK
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’)) […]
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 […]
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 […]
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 { […]
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 […]
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, […]
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 […]
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: […]
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 […]
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 […]
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 – […]
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 […]
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() { […]
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 […]
.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, […]
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 […]
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()) […]
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() { // […]
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 […]
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) […]
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 + […]
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: […]
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 […]
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: […]
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 […]
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Β° […]
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 […]
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 == […]
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 = […]













