๐ Hoisting = Declarations Move to Top JavaScript hoists declarations. Understand hoisting to avoid bugs. var, let, const, function declarations โ different hoisting behavior. ๐ var Hoisting console.log(x); // undefined (not error) var x = 5; // Equivalent to: var x; console.log(x); // undefined x = 5; // Function declaration hoisting sayHello(); // Works! function […]
Author: ErcanOPAK
HTML: Use Lists to Structure Content
๐ Lists = Organized Information Lists organize content. Ordered, unordered, definition lists. Essential for navigation, features, specs. ๐ List Types <!– Unordered list (bullets) –> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> <!– Ordered list (numbers) –> <ol> <li>First step</li> <li>Second step</li> <li>Third step</li> </ol> <!– Nested lists –> <ul> <li>Category 1 <ul> <li>Sub-item […]
CSS: Use Z-Index to Control Element Layering
๐ Elements Stack in 3D HTML elements stack vertically. Z-index controls overlap. Put modals on top, backgrounds behind. ๐ Z-Index Basics .modal { position: fixed; z-index: 1000; /* High number = on top */ } .dropdown { position: absolute; z-index: 100; /* Above content, below modal */ } .tooltip { position: absolute; z-index: 200; /* […]
Windows 11: Use Night Light to Reduce Eye Strain
๐ Blue Light = Sleep Disruption Screen blue light affects sleep. Night Light reduces blue light at night. Warmer colors, better sleep, less eye strain. ๐ง Enable Night Light Settings โ System โ Display โ Night light Quick toggle: Action Center โ Night light Schedule: – Sunset to sunrise (automatic, requires location) – Set custom […]
AI Prompt: Generate Professional Email Replies
โ๏ธ Reply to Emails Faster and Better Writing email replies takes time. AI generates professional replies based on the email. Edit, send, move on. ๐ The Prompt I received this email: [Paste the email you received] Context: – My role: [e.g., Software Engineer, Manager, Freelancer] – Relationship: [e.g., Client, Colleague, Manager, Vendor] – Desired tone: […]
Docker: View Container Logs with docker logs
๐ See What Your Container is Doing Containers run in background. docker logs shows stdout/stderr output. Debug, monitor, troubleshoot. ๐ Log Commands # View all logs docker logs container_name # Follow live logs docker logs -f container_name # Last 100 lines docker logs –tail 100 container_name # Since last 30 minutes docker logs –since 30m […]
Kubernetes: Use DaemonSets to Run Pods on Every Node
๐ก One Pod Per Node โ Automatically Need monitoring agent on every node? Log collector? DaemonSet runs one pod per node. New nodes get pod automatically. ๐ DaemonSet Example apiVersion: apps/v1 kind: DaemonSet metadata: name: node-monitor namespace: kube-system spec: selector: matchLabels: name: node-monitor template: metadata: labels: name: node-monitor spec: containers: – name: monitor image: prom/node-exporter […]
WordPress: Customize Login Page for Branding
๐จ Professional Login Page for Clients Default WordPress login looks generic. Custom login page shows your brand. Logo, colors, background โ professional impression. ๐ Custom Login CSS // functions.php function custom_login_logo() { echo ‘<style> body.login { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); } .login h1 a { background-image: url(‘ . get_stylesheet_directory_uri() . ‘/images/logo.png); background-size: contain; […]
Photoshop: Use Content-Aware Scale to Resize Images Without Distortion
๐ Resize Images, Keep Important Content Intact Normal scaling stretches everything. Content-Aware Scale protects important areas. Resize while preserving people, objects, faces. ๐ How to Use 1. Select layer 2. Edit โ Content-Aware Scale (Ctrl + Alt + Shift + C) 3. Drag handles to resize 4. Protected areas stay intact Protect specific areas: – […]
Visual Studio: Use Immediate Window to Execute Code During Debugging
๐ฅ๏ธ Debug Like a Pro Need to test a method while debugging? Immediate Window executes code on the fly. Test expressions, call methods, inspect variables. ๐ง Using Immediate Window Debug โ Windows โ Immediate (Ctrl + Alt + I) While debugging (breakpoint hit): – ? variableName โ Show variable value – ? myMethod() โ Call […]
C#: Use Delegates and Events for Callback Patterns
๐ Delegates = Function Pointers Passing methods as parameters? Delegates enable callbacks. Events enable notifications. Essential for event-driven programming. ๐ Delegates // Declare delegate public delegate void ProcessDelegate(string message); // Method matching delegate public void PrintMessage(string msg) => Console.WriteLine(msg); // Use delegate ProcessDelegate handler = PrintMessage; handler(“Hello”); // Multicast delegate handler += msg => Console.WriteLine($”Another: […]
C#: Use Generics for Type-Safe and Reusable Code
๐ฆ Generics = Type-Safe Reusable Code Object types lose type safety. Generics preserve types. Reusable code, compile-time safety, no casting. โ Without Generics public class List { private object[] _items; public void Add(object item) { } public object Get(int index) { } } // Boxed int, cast required โ With Generics public class List { […]
SQL: Use SELECT to Query Data from Tables
๐ SELECT = Read Data from Database Data is useless if you can’t read it. SELECT queries data. The most used SQL command. ๐ Basic SELECT — All columns SELECT * FROM users; — Specific columns SELECT name, email FROM users; — Distinct values SELECT DISTINCT country FROM users; — With alias SELECT name AS […]
.NET Core: Use Minimal APIs for Lightweight Services
โก APIs in 10 Lines of Code Controllers are overkill for simple APIs. Minimal APIs are lightweight, fast, and simple. Perfect for microservices. โ Controller (Verbose) [ApiController] [Route(“api/[controller]”)] public class UsersController : ControllerBase { [HttpGet] public async Task Get() { return await _db.Users.ToListAsync(); } } โ Minimal API var app = builder.Build(); app.MapGet(“/api/users”, async (AppDbContext […]
Git: Use Git Pull to Update Your Local Repository
โฌ๏ธ git pull = git fetch + git merge Team members push changes. git pull downloads and merges. Keep your local repo up to date. ๐ Basic Pull # Pull from default remote git pull # Pull from specific remote and branch git pull origin main # Pull and rebase (instead of merge) git pull […]
Ajax: Use Query Strings to Pass Data in GET Requests
๐ ?key=value โ Query Strings in URLs GET requests need parameters. Query strings pass data in URL. Search, filter, pagination โ all in the URL. ๐ Building Query Strings // Manual const url = `/api/users?page=1&limit=10&search=alice`; // URLSearchParams const params = new URLSearchParams(); params.append(‘page’, ‘1’); params.append(‘limit’, ’10’); params.append(‘search’, ‘alice’); const url = `/api/users?${params}`; // From object […]
JavaScript: Master Array Methods for Data Manipulation
๐ Arrays Are Everywhere Lists of data need manipulation. Array methods filter, map, reduce, sort. Essential for data processing. ๐ Common Array Methods // forEach: Iterate const numbers = [1, 2, 3, 4, 5]; numbers.forEach(n => console.log(n)); // map: Transform each element const doubled = numbers.map(n => n * 2); // [2, 4, 6, 8, […]
HTML: Use Anchor Tag for Links and Navigation
๐ Anchor Tag = The Web’s Foundation Links connect the web. <a> tag creates hyperlinks. Internal pages, external sites, email, phone, downloads. ๐ Basic Links <!– External link –> <a href=”https://example.com”>Example Website</a> <!– Internal link –> <a href=”/about”>About Us</a> <!– Link to section (anchor) –> <a href=”#section1″>Go to Section 1</a> <!– Email link –> <a […]
CSS: Use Gradients for Beautiful Backgrounds
๐ Solid Colors Are Boring Gradients add depth and visual interest. CSS gradients are easy, fast, no images needed. ๐ Gradient Types /* Linear Gradient */ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: linear-gradient(to right, #f093fb, #f5576c); background: linear-gradient(180deg, #4facfe, #00f2fe); /* Radial Gradient */ background: radial-gradient(circle, #ff6b6b, #ee5a6f); background: radial-gradient(ellipse, #56ab2f, #a8e063); /* Conic […]
Windows 11: Use Windows Terminal for Multiple Command Line Tabs
๐ฅ๏ธ PowerShell, CMD, WSL โ One Window Multiple terminal windows clutter taskbar. Windows Terminal has tabs. PowerShell, CMD, WSL, Azure Cloud Shell in one window. โจ๏ธ Windows Terminal Shortcuts Ctrl + Shift + T โ New tab Ctrl + Shift + W โ Close tab Ctrl + Tab โ Next tab Ctrl + Shift + […]
AI Prompt: Analyze Customer Feedback and Reviews
๐ Understand What Customers Really Think Hundreds of reviews, hard to summarize. AI analyzes feedback โ sentiment, trends, common issues. Actionable insights. ๐ The Prompt Analyze these customer reviews: [Paste 10-20 reviews here] Provide: 1. Overall Sentiment Summary – Positive percentage – Negative percentage – Neutral percentage – Overall score (1-5) 2. Key Themes (Top […]
Docker: Use Environment Variables for Configuration
๐ง Configure Containers with Environment Variables Hardcoded config in image is bad. Environment variables configure containers at runtime. Change without rebuild. ๐ Setting Environment Variables # Docker run docker run -e DB_HOST=postgres -e DB_USER=admin myapp # Dockerfile ENV DB_HOST=postgres ENV DB_USER=admin # Using .env file docker run –env-file .env myapp # Docker Compose services: app: […]
Kubernetes: Use StorageClasses for Dynamic Volume Provisioning
๐พ StorageClasses Create Volumes Automatically Manual volume creation is tedious. StorageClasses provision volumes dynamically. Specify storage type, size, performance. ๐ StorageClass Examples apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: fast-ssd provisioner: kubernetes.io/aws-ebs parameters: type: gp3 encrypted: “true” iopsPerGB: “50” allowVolumeExpansion: true — apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: standard provisioner: kubernetes.io/aws-ebs parameters: type: gp2 encrypted: “true” […]
WordPress: Use Query Monitor to Debug Performance Issues
๐ Debug Slow Queries and Performance Site slow? Query Monitor shows database queries, hooks, memory usage, page speed. Essential debugging plugin. ๐ What Query Monitor Shows Install: Plugins โ Add New โ Query Monitor Dashboard shows: – Database Queries (count + time) – Page Generation Time – Memory Usage – Hook execution – HTTP API […]
Photoshop: Use Adjustment Layers for Non-Destructive Editing
๐จ Edit Colors Without Destroying Pixels Direct color changes are permanent. Adjustment Layers are non-destructive. Toggle on/off, change settings anytime. ๐ Common Adjustment Layers Levels: – Adjust shadows, midtones, highlights – Fix underexposed images Curves: – Precise tonal control – Professional color grading Hue/Saturation: – Change color cast – Boost vibrance – Recolor specific ranges […]
Visual Studio: Use Find in Files to Search Across Entire Solution
๐ Ctrl + Shift + F โ Search Everything Ctrl+F searches current file. Ctrl+Shift+F searches entire solution. Find references, TODO comments, API usage across all files. ๐ง Find in Files Ctrl + Shift + F โ Open Find in Files Search options: – Current Document – Current Project – Entire Solution – All Open Documents […]
C#: Use try-catch-finally for Robust Error Handling
โ ๏ธ Handle Errors Gracefully Exceptions happen. try-catch-finally handles them. Prevent crashes, log errors, clean up resources. ๐ Basic Exception Handling try { // Code that might throw int result = 10 / 0; // DivideByZeroException } catch (DivideByZeroException ex) { Console.WriteLine(“Cannot divide by zero: ” + ex.Message); } catch (Exception ex) { Console.WriteLine(“General error: ” […]
C#: Use Inheritance for Code Reuse
๐ฆ Inheritance = Is-A Relationship Duplicate code is bad. Inheritance reuses code. Child inherits from parent. Shared behavior, overridden methods. ๐ Inheritance Example public class Animal { public string Name { get; set; } public void Eat() { Console.WriteLine($”{Name} is eating”); } public void Sleep() { Console.WriteLine($”{Name} is sleeping”); } } public class Dog : […]
SQL: Use DELETE to Remove Data from Tables
๐๏ธ DELETE = Remove Rows Data needs removal. DELETE removes rows. Be careful โ without WHERE, deletes all rows. Use transactions. ๐ Basic DELETE — Delete specific row DELETE FROM users WHERE id = 123; — Delete multiple rows DELETE FROM users WHERE status = ‘inactive’; — Delete all rows (careful!) DELETE FROM users; — […]
.NET Core: Use Authorization for Access Control
๐ Authorization = Who Can Access Authentication identifies users. Authorization controls access. Roles, policies, permissions โ fine-grained control. ๐ Role-Based Authorization [Authorize(Roles = “Admin”)] public class AdminController : Controller { public IActionResult Dashboard() { } } [Authorize(Roles = “Admin,Manager”)] public IActionResult Reports() { } // In Program.cs builder.Services.AddAuthorization(options => { options.AddPolicy(“AdminOnly”, policy => policy.RequireRole(“Admin”)); }); […]













