๐ซ Dedicated Nodes for Special Workloads Some nodes have GPUs. Some are spot instances. Taints repel pods. Tolerations allow them. Control exactly where workloads run. ๐ Add Taint to Node # Taint effects: # NoSchedule: Pods without toleration won’t be scheduled # PreferNoSchedule: Avoid if possible # NoExecute: Evict existing pods without toleration # Add […]
Month: May 2026
WordPress: Control Autoloaded Options to Speed Up Admin
โก 80% of Options Load on Every Page WordPress loads all ‘autoload’ options on every request. Many are never used. Clean your autoloaded options for faster admin. ๐ Check Autoloaded Options — SQL Query to see autoloaded options SELECT COUNT(*), SUM(LENGTH(option_value)) as total_size FROM wp_options WHERE autoload = ‘yes’; — List largest autoloaded options SELECT […]
Photoshop: Master Clone Stamp for Perfect Retouching
๐จ Copy Pixels from Anywhere Remove blemishes, duplicate objects, fix textures. Clone Stamp copies from one area and paints to another. Essential for retouching. โจ๏ธ Shortcuts S โ Select Clone Stamp Alt+Click โ Set source point [ / ] โ Decrease/Increase brush size Shift+[ / ] โ Decrease/Increase brush hardness Alt+Shift+Click โ Set source from […]
Visual Studio: Use Temporary Breakpoints That Delete Themselves After Hit
๐ฏ Break Once, Then Vanish Need to inspect a value just once? Regular breakpoint pauses every time. Temporary breakpoints delete themselves after first hit. Perfect for one-time inspections. ๐ง How to Create Method 1: Right-click breakpoint โ Conditions โ Check “Remove breakpoint when hit” Method 2: Hover over red breakpoint dot โ Settings gear โ […]
C#: Use DateOnly and TimeOnly When You Don’t Need DateTime
๐ Date Without Time. Time Without Date. Birthday has no time. Alarm has no date. DateOnly and TimeOnly prevent bugs from midnight times, time zones, and meaningless components. ๐ DateOnly Examples // Create DateOnly DateOnly birthday = new DateOnly(1990, 5, 15); DateOnly today = DateOnly.FromDateTime(DateTime.Today); // Parse DateOnly parsed = DateOnly.Parse(“2024-12-25”); // Operations DateOnly tomorrow […]
C#: Use Caller Info Attributes for Better Logging Without Reflection
๐ Know Who Called You Logging without caller info is useless. Caller Info Attributes give you file path, line number, member name โ at compile time. Zero performance cost. ๐ Basic Usage using System.Runtime.CompilerServices; public static void Log(string message, [CallerFilePath] string file = “”, [CallerLineNumber] int line = 0, [CallerMemberName] string member = “”) { […]
SQL: Use Recursive CTE to Query Hierarchical Data (Employee Trees)
๐ณ Self-Joins Are Painful. CTE Makes It Easy. Org charts, categories, comments, folder trees โ all hierarchical. Recursive CTEs query parent-child relationships elegantly. ๐ Employee Hierarchy — Table structure CREATE TABLE employees ( id INT PRIMARY KEY, name VARCHAR(100), manager_id INT REFERENCES employees(id) ); — Recursive CTE to get org tree WITH RECURSIVE org_tree AS […]
.NET Core: Use Problem Details for Standardized API Error Responses
๐ RFC 7807 Standard Errors Every API invents its own error format. Problem Details (RFC 7807) standardizes HTTP error responses. Clients understand errors universally. ๐ Enable Problem Details // Program.cs builder.Services.AddProblemDetails(); var app = builder.Build(); app.UseStatusCodePages(); // or app.UseProblemDetails(); // More control // Now 404, 400, 500 errors return RFC 7807 format ๐ฏ Custom Problem […]
Git: Use Worktrees to Work on Multiple Branches at Once
๐ฒ Multiple Checkouts, One Repository Need to compare main vs feature branch? Stash not enough? git worktree checks out multiple branches simultaneously. No switching, no stashing. ๐ Basic Worktree # Create worktree for feature branch git worktree add ../project-feature feature-branch # Now you have: # /project (main branch) # /project-feature (feature-branch) # Open both in […]
Ajax: Use Navigator.sendBeacon() for Reliable Analytics on Page Unload
๐ก Track User Actions Even When They Leave fetch() on page unload gets cancelled. sendBeacon() sends data asynchronously, survives page close. Perfect for analytics, logging, exit tracking. ๐ Basic Usage // Track page unload window.addEventListener(‘beforeunload’, () => { const data = { event: ‘page_exit’, timeOnPage: performance.now(), url: window.location.href }; const blob = new Blob([JSON.stringify(data)], {type: […]
JavaScript: Use structuredClone() for True Deep Copy of Objects
๐ฆ Finally, True Deep Copy Without Libraries JSON.parse(JSON.stringify()) fails with dates, undefined, functions. structuredClone() handles dates, maps, sets, arrays, nested objects โ everything. โ JSON Hack (Broken) const obj = { date: new Date(), fn: () => {}, undef: undefined }; const copy = JSON.parse(JSON.stringify(obj)); // date becomes string! // fn and undef are gone! […]
HTML: Use Download Attribute to Force File Download Instead of Opening
๐ฅ Click to Download, Not to Preview PDF opens in browser. Image displays. User right-clicks, “Save as”. download attribute forces download with custom filename. ๐ Basic Usage <!– Download with original filename –> <a href=”/files/report.pdf” download>Download PDF</a> <!– Download with custom filename –> <a href=”/files/report.pdf” download=”Q4_Report_2024.pdf”> Download PDF </a> <!– Image download –> <a href=”image.jpg” […]
CSS: Use Scroll Snap for Smooth, Snap-to-Section Scrolling
๐ฑ Native Scroll Snap โ No JavaScript Horizontal carousels, full-page scroll, image galleries โ all with CSS scroll snap. No JS, smooth physics, works everywhere. ๐ Full-Page Vertical Scroll Snap .container { scroll-snap-type: y mandatory; overflow-y: scroll; height: 100vh; } .section { scroll-snap-align: start; height: 100vh; } /* HTML structure */ <div class=”container”> <section class=”section”>Page […]
Windows 11: Create God Mode Folder for All Settings in One Place
๐ All Control Panels, One Folder Settings scattered everywhere. God Mode creates a folder with EVERY setting. Administrative Tools, Ease of Access, Network, Personalization โ all in one place. ๐ง Create God Mode Folder 1. Right-click on Desktop 2. New โ Folder 3. Rename folder to: GodMode.{ED7BA470-8E54-465E-825C-99712043E01C} 4. Press Enter 5. Double-click folder โ Contains […]
AI Prompt: Generate Complex Terminal Commands from Plain English
๐ป “Find all files modified yesterday” โ Terminal Command Can’t remember sed syntax? Awk? Grep flags? AI translates English to shell commands. Stop Googling, start doing. ๐ The Prompt Generate a terminal command (bash/zsh) for: [Describe what you want to do] Requirements: – Use safe flags (no destructive commands unless specified) – Include explanation of […]
Docker: Enable BuildKit for Faster, More Secure Image Builds
โก Parallel Builds = 2x Faster Old Docker builds run sequentially. BuildKit runs independent stages in parallel. Skipping unused stages. Secret mount without layers. Game changer. ๐ง Enable BuildKit # Environment variable export DOCKER_BUILDKIT=1 docker build . # Or always enable (add to ~/.docker/config.json) { “auth”: { … }, “features”: { “buildkit”: true } } […]
Kubernetes: Use PodDisruptionBudget to Prevent Service Interruption
๐ก๏ธ Don’t Drain All Pods at Once Node draining, cluster upgrades, autoscaling down โ they all kill pods. PodDisruptionBudget ensures minimum availability during voluntary disruptions. ๐ PDB Examples # At least 2 pods available at all times apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: app-pdb spec: minAvailable: 2 selector: matchLabels: app: myapp # No more than […]
WordPress: Control Heartbeat API to Reduce Server Load
โค๏ธ Your Admin Is Making Unnecessary Requests WordPress Heartbeat API pings server every 15-60 seconds. On high-traffic admin, this kills performance. Control or disable it. ๐ Reduce Heartbeat Frequency // functions.php add_filter(‘heartbeat_settings’, ‘custom_heartbeat_settings’); function custom_heartbeat_settings($settings) { $settings[‘interval’] = 120; // Change to 120 seconds (default 15) return $settings; } // Disable completely on admin add_action(‘init’, […]
Photoshop: Use Content-Aware Fill to Remove Objects Like Magic
โจ Make Objects Disappear Tourist in background? Unwanted logo? Content-Aware Fill analyzes surrounding pixels and fills selection seamlessly. Like magic eraser. ๐ How To Use 1. Select object to remove (Lasso, Pen, Magic Wand) 2. Edit โ Fill (Shift+F5) 3. In dialog: Contents โ Content-Aware 4. Opacity: 100% 5. Click OK โ Object disappears! For […]
Visual Studio: Use Peek Definition (Alt+F12) Without Leaving Your File
๐ See Code Without Opening New Tabs F12 opens new tab, breaks flow. Alt+F12 (Peek Definition) shows code inline. Edit, navigate, close with Esc. Stay in context. โจ๏ธ Shortcuts Alt+F12 โ Peek Definition (inline view) Shift+Alt+F12 โ Peek References (where method is used) Ctrl+Alt+F12 โ Peek to Implementation (interfaces) Within peek window: Ctrl+Alt+Home โ Promote […]
C#: Use Native AOT to Compile .NET Apps to Single Executables
๐ฆ One .exe, No Runtime Required .NET app needs runtime installed. Native AOT compiles to single native executable. Fast startup, small container size, no .NET on target machine. ๐ง Enable Native AOT <PropertyGroup> <PublishAot>true</PublishAot> </PropertyGroup> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> <PublishAot>true</PublishAot> <JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault> <TrimMode>full</TrimMode> </PropertyGroup> โ๏ธ Publish Command # Windows (x64) dotnet publish -c Release -r win-x64 –self-contained -p:PublishAot=true […]
C#: Use Span for High-Performance Memory Access Without Allocation
โก Zero-Allocation Slicing Span<T> gives a view into memory without copying. No allocations, no GC pressure. Ideal for parsing, string manipulation, and high-performance scenarios. โ Allocating Substring // Allocates new string (GC pressure) string data = “123,456,789”; string first = data.Substring(0, 3); // New string allocation string second = data.Substring(4, 3); // Another allocation // […]
SQL: Use Partial Indexes to Index Only Relevant Rows
๐ฏ Index Only What You Query Full indexes waste space. Partial indexes index only rows matching a WHERE clause. Smaller, faster, more efficient. ๐ Basic Partial Index — Index only active users (not soft-deleted) CREATE INDEX idx_active_users_email ON users(email) WHERE deleted_at IS NULL; — Query uses this index automatically SELECT * FROM users WHERE email […]
.NET Core: Understanding Middleware Order (It Matters!)
๐ Order of Registration = Order of Execution Wrong middleware order = broken app. Auth before Routing? Exception handling after everything? Order matters dramatically. โ Correct Order (Recommended) var app = builder.Build(); // 1. Exception handling (catch errors from everything) if (app.Environment.IsDevelopment()) app.UseDeveloperExceptionPage(); else app.UseExceptionHandler(“/error”); // 2. Security (run early) app.UseHsts(); app.UseHttpsRedirection(); // 3. Static […]
Git: Use Reflog to Recover Deleted Commits and Branches
๐ฐ๏ธ Git’s Time Machine Accidentally deleted branch? Reset –hard too far? Reflog logs every HEAD change. Rewind time, recover lost work. ๐ View Reflog # View all reflog entries git reflog # Output: # a1b2c3d HEAD@{0}: commit: Add feature # d4e5f6g HEAD@{1}: checkout: moving from main to feature # g7h8i9j HEAD@{2}: reset: moving to HEAD~2 […]
Ajax: Use FormData API for File Uploads Without Libraries
๐ Drag & Drop + Progress Bar, Native No more FormData polyfills. FormData API sends forms + files with fetch. Track upload progress, handle multiple files. ๐ Basic File Upload <input type=”file” id=”fileInput” multiple> <button onclick=”uploadFiles()”>Upload</button> <progress id=”progressBar” value=”0″ max=”100″></progress> async function uploadFiles() { const files = document.getElementById(‘fileInput’).files; const formData = new FormData(); for (let […]
JavaScript: Use Top-Level Await in Modules for Cleaner Async Code
โฐ Async Without Async Function Wrapper Need await at top level? Used to need IIFE. Top-level await works directly in ES modules. Cleaner initialization code. โ Old Way (IIFE) (async () => { const data = await fetch(‘/api/config’); const config = await data.json(); startApp(config); })(); โ Top-Level Await // In .mjs or type=”module” script const […]
HTML: Use Native Dialog Element for Modals Without JavaScript Libraries
๐ฑ Built-in Modal, No Library <dialog> element creates native modals. Accessibility, focus management, backdrop โ all built-in. No more 100KB modal libraries. ๐ Basic Dialog <dialog id=”myDialog”> <h2>Confirm Action</h2> <p>Are you sure you want to delete this item?</p> <form method=”dialog”> <button value=”cancel”>Cancel</button> <button value=”confirm”>Confirm</button> </form> </dialog> <button onclick=”myDialog.showModal()”>Open Modal</button> <script> myDialog.addEventListener(‘close’, () => { console.log(‘Closed […]
CSS: Use :has() Selector to Style Parent Elements Based on Children
๐จโ๐ง Parent Finally Knows About Child CSS couldn’t select parent based on children. Until now. :has() changes everything โ style parent when child exists. โ Before :has() // JavaScript needed if (card.querySelector(‘.badge’)) { card.classList.add(‘has-badge’); } โ With :has() // Pure CSS! .card:has(.badge) { border-left: 4px solid gold; } ๐ฏ Powerful Examples // Style form that […]
Windows 11: Use Focus Sessions to Eliminate Distractions
๐ง Built-In Pomodoro Timer Notifications, taskbar badges, flashing icons โ all distractions. Focus Sessions silence everything, set timers, track productivity. ๐ง Start a Focus Session Method 1: Clock app โ Focus Sessions Method 2: Taskbar clock/calendar โ Focus Method 3: Settings โ System โ Focus Shortcut: Win + N โ Focus โ๏ธ Configure Do Not […]













