๐ Who Wrote This Code? Bug in production. Need to know who wrote line 247. git blame tells you author, date, commit. Basic Usage # Entire file git blame filename.js # Specific line range git blame -L 100,150 filename.js # Show line 247 only git blame -L 247,247 filename.js # Output: # abc12345 (John Doe […]
Author: ErcanOPAK
Git: Use Interactive Rebase to Clean Up Commit History
โจ Rewrite Git History Like a Pro 10 messy commits saying ‘fix’, ‘oops’, ‘wtf’. Interactive rebase turns them into one clean, professional commit. Start Interactive Rebase # Rebase last 5 commits git rebase -i HEAD~5 # Or from specific commit git rebase -i abc1234 # Editor opens with commit list: pick abc1234 Add login feature […]
AJAX: Implement Exponential Backoff for Failed Requests
๐ Handle Network Failures Gracefully Request fails. You retry immediately. Fails again. Server overwhelmed. Exponential backoff fixes this. The Pattern async function fetchWithRetry(url, options = {}, maxRetries = 3) { for (let i = 0; i = 500 || response.status === 429) { if (i === maxRetries) throw new Error(‘Max retries reached’); // Exponential backoff: […]
JavaScript: Use Optional Chaining (?.) to Avoid Nested If Checks
๐ Access Deep Properties Safely Tired of user && user.address && user.address.city? Optional chaining makes it user?.address?.city The Old Nightmare // โ Verbose null checking const city = user && user.address && user.address.city; // โ Even worse with functions const result = obj && obj.method && obj.method(); // โ Nested ternaries const name = data […]
HTML5: Use for Art Direction and Responsive Images
๐ผ๏ธ Serve Perfect Image for Every Device Desktop gets landscape. Mobile gets portrait. WebP for modern browsers, JPEG fallback. <picture> handles it all. Basic Responsive Images Art Direction (Different Crops) ๐ฏ Advanced: Resolution + Format ๐ก Why Use <picture>? Performance: Serve WebP (30% smaller) to supporting browsers Art Direction: Show different crops on different screens […]
CSS: Use clamp() for Responsive Typography Without Media Queries
๐ Fluid Typography That Just Works Writing 5 media queries for font sizes? clamp() does it in one line. Responsive typography perfected. The Old Way (Painful) h1 { font-size: 24px; } @media (min-width: 640px) { h1 { font-size: 32px; } } @media (min-width: 768px) { h1 { font-size: 40px; } } @media (min-width: 1024px) { […]
Windows 11: Use Quick Settings for One-Click System Controls
โก Control Panel Reinvented WiFi, Bluetooth, volume, brightness – all in one swipe. Quick Settings is your new command center. Access: Win + A (or click WiFi/Volume/Battery icons in taskbar) ๐๏ธ Quick Toggles WiFi on/off + network selector Bluetooth + device pairing Volume slider + output device Brightness slider Focus Assist (DND) Night Light Airplane […]
Windows 11: Use Snap Layouts for Instant Window Organization
๐ Organize Windows in One Click Dragging windows to resize them? Slow. Snap Layouts give you 6 pre-made layouts instantly. How to Use: Hover over maximize button โ Choose layout โ Click zone for each window ๐ฑ Available Layouts 2 columns: 50/50 split (classic side-by-side) 3 columns: Equal thirds or 50/25/25 4 corners: Each window […]
AI Prompt: Generate Complex Regex Patterns in Plain English
๐ค Regex Without the Pain Need to validate email? Extract phone numbers? Parse log files? Describe it in English, AI writes the regex. The Regex Prompt Create a regex pattern that matches: [Describe what you want to match] Requirements: – Provide the regex pattern – Explain each part of the pattern – Give 5 examples […]
AI Prompt: Generate Unit Tests with 90% Coverage Instantly
๐งช Write Tests 100x Faster Writing tests is tedious. AI generates comprehensive test suites in seconds. Edge cases included. The Test Generation Prompt Generate comprehensive unit tests for this code: [Paste your function/class] Requirements: – Use [Testing Framework: Jest/xUnit/pytest/etc] – Test happy path – Test edge cases (null, empty, invalid input) – Test error conditions […]
AI Prompt: Get Senior-Level Code Reviews Instantly
๐จโ๐ป Your Personal Senior Developer No senior dev on team? AI reviews your code like one. Security holes, performance issues, best practices – all caught instantly. The Ultimate Code Review Prompt Review this code as a senior developer: [Paste your code] Check for: 1. Security vulnerabilities (SQL injection, XSS, secrets in code) 2. Performance issues […]
Docker: Use .dockerignore to Speed Up Builds 10x
๐ Stop Copying Unnecessary Files Docker copying 2GB node_modules to build context? .dockerignore file fixes this. Without .dockerignore: Docker copies ENTIRE directory to build context. With .dockerignore: Copies only what you need. Essential .dockerignore # .dockerignore file node_modules npm-debug.log dist build .git .env .DS_Store *.md .vscode .idea coverage __pycache__ *.pyc .pytest_cache โก Impact Before Build […]
Kubernetes: Use kubectl port-forward to Debug Services Locally
๐ Access K8s Services Like They’re Local Service running in cluster. Need to test it. Don’t want to expose it publicly. Port-forward to localhost. Basic Port Forward # Forward pod port to localhost kubectl port-forward pod/my-pod 8080:80 # Now access: http://localhost:8080 # Traffic goes to pod’s port 80 # Forward service instead kubectl port-forward svc/my-service […]
WordPress Transients: Cache Data Without a Plugin
โก Built-in Caching System API call taking 2 seconds? Database query slow? Cache it with Transients API. No plugin needed. Basic Usage // Get from cache $data = get_transient(‘my_cached_data’); // Not in cache? Get fresh data if (false === $data) { $data = expensive_api_call(); // Store for 1 hour (3600 seconds) set_transient(‘my_cached_data’, $data, HOUR_IN_SECONDS); } […]
WordPress Query Monitor: Debug Performance Issues in Real Time
๐ X-Ray Vision for WordPress Site slow? Don’t know why? Query Monitor shows every database query, hook, HTTP request in real time. Install: Plugins โ Add New โ Query Monitor โ Free, 100K+ active installs What It Shows โ Database Queries: Slow queries highlighted, execution time, duplicate queries โ PHP Errors: Notices, warnings, fatal errors […]
Photoshop Liquify: Reshape Anything Without Destroying Pixels
๐ Warp Reality with Liquify Push, pull, twist, pinch any part of image. Non-destructive. Undo anytime. Liquify is Photoshop’s secret weapon. Access: Filter โ Liquify (or Shift+Ctrl+X) Essential Tools ๐๏ธ Forward Warp Push pixels in any direction. Main tool for reshaping. ๐ Twirl Clockwise Create spiral effects. Hold for continuous twist. ๐ Pucker Pinch pixels […]
Photoshop Content-Aware Fill: Remove Anything From Photos Like Magic
โจ Photoshop’s AI-Powered Eraser Tourist photobombing your perfect shot? Unwanted object ruining composition? Content-Aware Fill removes it seamlessly. Traditional method: Clone Stamp tool for 30 minutes, still looks fake. Content-Aware: Select object, fill, done in 10 seconds. How It Works 3-Step Process Select unwanted object: Use Lasso Tool (L) to outline Edit โ Fill: Choose […]
Visual Studio 2022: Hot Reload – The Feature That Changes Everything
๐ฅ Edit Running Code Without Restarting Change code while debugging. See results instantly. No stop. No rebuild. No restart. This is Hot Reload. What Is Hot Reload? Traditional workflow: Edit code โ Stop debugger โ Rebuild โ Restart โ Navigate back to same screen. 2-5 minutes lost per change. Hot Reload workflow: Edit code โ […]
C#: Use Target-Typed new for Cleaner Code
Type name repeated on both sides. Redundant. // โ Verbose Dictionary<string, List> dict = new Dictionary<string, List>(); // โ Target-typed new (C# 9+) Dictionary<string, List> dict = new(); // Works everywhere List users = new(); var service = new UserService(); return new User { Name = “John” }; // Field initialization private readonly HttpClient _client […]
C#: Use global using to Import Namespaces Once
Every file: using System.Linq; using System.Collections.Generic; Global Usings: Import once, available everywhere. // Create Usings.cs global using System; global using System.Linq; global using System.Collections.Generic; global using Microsoft.EntityFrameworkCore; // Now all files in project have these // No need to repeat in every file Implicit Global Usings: Enable in .csproj: enable Common namespaces auto-imported.
C#: Use File-Scoped Namespaces to Reduce Indentation
Entire file indented one level for namespace. Wasted space. // โ Old way (extra indentation) namespace MyApp.Services { public class UserService { public void DoSomething() { // Code here } } } // โ File-scoped namespace (C# 10+) namespace MyApp.Services; public class UserService { public void DoSomething() { // Code here – one less indent […]
SQL: Use OFFSET FETCH for Pagination
Building pagination? OFFSET FETCH is standard SQL way. — Page 1 (rows 1-10) SELECT * FROM Products ORDER BY ProductId OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY; — Page 2 (rows 11-20) SELECT * FROM Products ORDER BY ProductId OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY; — Dynamic pagination DECLARE @PageNumber INT = […]
SQL: Use COALESCE to Handle NULL Values
NULL values breaking calculations? Use COALESCE for fallback. — Returns first non-NULL value SELECT COALESCE(Phone, Email, ‘No contact’) AS Contact FROM Users; — Default values in calculations SELECT Name, Price * COALESCE(Quantity, 0) AS Total FROM Orders; — Multiple fallbacks SELECT COALESCE(PreferredName, FirstName, ‘Unknown’) AS DisplayName FROM Users; vs ISNULL: COALESCE is ANSI standard (works […]
.NET Core: Use Health Checks for Monitoring
How do you know if your API is healthy? Database connected? Redis alive? // Program.cs builder.Services.AddHealthChecks() .AddDbContextCheck() .AddRedis(“localhost:6379”); app.MapHealthChecks(“/health”); // Visit /health // Response: Healthy or Unhealthy + details Custom Check: public class ApiHealthCheck : IHealthCheck { public async Task CheckHealthAsync(…) { var isHealthy = await CheckExternalApiAsync(); return isHealthy ? HealthCheckResult.Healthy() : HealthCheckResult.Unhealthy(“API down”); } […]
.NET Core: Use Response Caching Middleware for Static APIs
API returns same data for 10 minutes. Still hitting database every request. // Program.cs builder.Services.AddResponseCaching(); var app = builder.Build(); app.UseResponseCaching(); // Controller [ResponseCache(Duration = 600)] // 10 minutes public IActionResult GetProducts() { return Ok(_db.Products.ToList()); } Headers: Sets Cache-Control headers automatically. Browser + server cache. Vary: Cache different responses per user: VaryByHeader = “Authorization” Disable: [ResponseCache(NoStore […]
Git: Use git cherry-pick to Copy Commits Between Branches
Fixed bug in wrong branch. Need same fix in another branch. Don’t want to merge entire branch. # Switch to target branch git checkout main # Cherry-pick specific commit from other branch git cherry-pick abc1234 # Cherry-pick multiple commits git cherry-pick abc1234 def5678 ghi9012 # Cherry-pick range git cherry-pick abc1234..def5678 Conflicts: If conflict occurs, resolve […]
Git: Use git stash -p to Stash Specific Changes
Made 10 changes. Want to stash only 3. git stash takes everything. # Interactive stash (choose what to stash) git stash -p # Git asks for each change: # Stash this hunk? y/n/q/a/d/e y = yes, stash this n = no, keep this q = quit a = stash all remaining d = don’t stash […]
AJAX: Use fetch() timeout with AbortController
Request hangs forever. No timeout in fetch API. Need manual solution. const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), 5000); try { const response = await fetch(url, { signal: controller.signal }); clearTimeout(timeoutId); return await response.json(); } catch (error) { if (error.name === ‘AbortError’) { console.log(‘Request timeout’); } } Reusable Function: async function […]
JavaScript: Use structuredClone for Deep Object Copy
Deep cloning objects? JSON.parse(JSON.stringify()) fails on dates, functions, undefined. // โ Old way (loses dates, functions) const copy = JSON.parse(JSON.stringify(original)); // โ New way (preserves everything) const copy = structuredClone(original); // Works with: // – Nested objects // – Arrays // – Dates // – Maps, Sets // – RegExp // – ArrayBuffer Performance: Faster […]



















