Skip to content

Instantly share code, notes, and snippets.

@tshego3
Last active April 21, 2026 12:48
Show Gist options
  • Select an option

  • Save tshego3/7d918ed092732c842802a302df4de443 to your computer and use it in GitHub Desktop.

Select an option

Save tshego3/7d918ed092732c842802a302df4de443 to your computer and use it in GitHub Desktop.

Development Nexuses

Wiki Navigation

Wiki Navigation

Standard Nexuses

Standard Nexuses

Standard Nexuses:
Website Link
ev.io Open link
Chess Open link
Gemini Open link
Copilot Open link
ChatGPT Open link
Open WebUI Open link
Vumatel Open link
Afrihost Open link
TP-Link MiFi Open link
TP-Link Modem Open link
C# Cheatsheet Open link
React Cheatsheet Open link
Blazor Cheatsheet Open link
Flutter Cheatsheet Open link
Angular Cheatsheet Open link
Huawei Mobile WiFi Open link
Development Nexuses Open link
.NET MAUI Cheatsheet Open link
TypeScript Cheatsheet Open link
Office365 - Outlook Open link
Microsoft Online Login Open link
Repository Manager Client Open link
Visual Studio Code for the Web Open link
Android SDK Manual Setup Guide Open link
D365 F&O Development Processes Open link
Local AI coding model on macOS with VS Code Open link
Full-Stack React + Prisma + PostgreSQL with Podman (or Docker) Open link
Enterprise ERP Development with Blazor SSR & Clean Architecture Open link
Enterprise ERP Development with Vite & the Full TanStack Stack: A "Blazor-Style" Approach Open link
EnergyInsight - TMM@Pay13:
DEV Nexuses
  • explorer.autoReveal: false (Disables the Explorer view automatically expanding folders to show the currently active file)
  • workbench.editor.enablePreview: false (Disables preview mode entirely, so single-click opens permanently)
  • workbench.list.openMode: doubleClick (Requires double-click to open files in lists like Explorer)
  • explorer.autoOpenDroppedFile: false (Prevents files dragged/dropped/pasted into Explorer from opening)
  • workbench.editor.enablePreviewFromQuickOpen: false (Ensures files from Quick Open don't open in preview mode)
Alternative Nexuses
Other
Project Nexuses

Project Nexuses

Project Nexuses:
Project Link
JS Twitter Feed Open link
JS RSS Feed Open link
RSS Reader Open link
RSS Reader (WASM) Open link
Sharp AES Crypt WASM Core Open link
JavaScript AES Encryption equivalent of C# Open link
JS Aes File Encryption Tool Open link
JavaScript Base64 Converter Open link
JavaScript Base64 Converter (Gist) Open link
JS Newline Remover Tool Open link
Apple Music Playlist Importer Open link
EOI Workouts Open link
EOI Sign in Open link
EOI Sign in (WASM) Open link
EOI Sign in (WASM) - Login Page Open link
EOI New Quotation (WASM) Open link
EOI New Quotation (WASM) - localhost Open link
Repository Manager Open link
Notes Repository Open link
Nexuses Repository Open link
Vibrations Repository Open link
Repository Manager Client Open link
Microsoft Edge Start Modes

Microsoft Edge Start Modes

Microsoft Edge Start Modes:
Media Nexuses

Media Nexuses

Media Nexuses:
PowerShell

PowerShell

PowerShell Convert file to Base64 string format
  • File Command:
[convert]::ToBase64String((Get-Content -path "your_file_path" -Encoding byte))
# Read the binary content of the PDF file
$fileBytes = [System.IO.File]::ReadAllBytes("C:\Users\User\Downloads\Sample.pdf")

# Convert the binary content to Base64
$base64String = [Convert]::ToBase64String($fileBytes)

# Output the Base64 string
Write-Output $base64String
  • Text Command:
[convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes("Hello world"))
  • Base64 to File Command:
# Base64 encoded string representing the PDF content
$base64String = "JVBERi0xLjUKJb/7 ..."

# Try to convert Base64 string to byte array
try {
    $pdfBytes = [System.Convert]::FromBase64String($base64String)
}
catch {
    Write-Output "Error: Unable to decode Base64 string. Details: $_"
    Exit
}

# Specify the output file path
$outputFilePath = "C:\path\to\output.pdf"

# Try to write the byte array to a PDF file
try {
    [System.IO.File]::WriteAllBytes($outputFilePath, $pdfBytes)
    Write-Output "PDF file successfully created at $outputFilePath"
}
catch {
    Write-Output "Error: Unable to write PDF file. Details: $_"
}
PowerShell Loop through each JSON object
# URL of the JSON endpoint
$url1 = "{endpoint}"
$url2Prep = "{endpoint}/{Operation}"

# Bearer token provided in a variable (replace with actual token)
$token = "tyJ0eX..."

# Headers including the Authorization token
$headers = @{
    "Authorization" = "Bearer $token"
}

# Send request to the API endpoint and retrieve JSON response
try {
    $response = Invoke-RestMethod -Uri $url1 -Headers $headers -Method Get -ContentType "application/json"
    
    # Check if the response contains the "Services" array
    if ($response.Operations -is [array]) {
        foreach ($operation in $response.Operations) {
            Write-Output "METHODNAME: " $operation.Name

            $url2 = $url2Prep.Replace("{Operation}", $operation.Name)
            $url2Result = Invoke-RestMethod -Uri $url2 -Headers $headers -Method Get -ContentType "application/json"

            if ($url2Result.Parameters -is [array]) {
                Write-Output "PARAMETERNAMES:"

                foreach ($parameter in $url2Result.Parameters) {
                    Write-Output $parameter.Name
                }
            }
        }
    } else {
        Write-Output "Error: No 'Services' array found in the response."
    }
}
catch {
    Write-Output "Error retrieving data from API: $_"
}
PowerShell to update the web.config file
# Load the Web.config file
[xml]$webConfig = Get-Content 'C:\inetpub\wwwroot\WebApp\Web.config'

# Find the appSettings key to update
$appSetting = $webConfig.configuration.appSettings.add | Where-Object { $_.key -eq 'ida:RedirectUri' }

# Update the value
$appSetting.value = 'https://www.endpoint.com/'

# Save the changes back to the Web.config file
$webConfig.Save('C:\inetpub\wwwroot\WebApp\Web.config')
PowerShell to update the appsettings.json file
# Read the JSON file
$json = Get-Content -Path "C:\inetpub\wwwroot\WebApp\appsettings.json" -Raw | ConvertFrom-Json;

# Update the value
$jsonValue = "https://www.endpoint.com/";
$json.RedirectUri = $jsonValue;
$json.Active = $true; # Note: $true is the correct boolean value in PowerShell

# Save the updated JSON back to the file
$json | ConvertTo-Json -Depth 32 | Set-Content -Path "C:\inetpub\wwwroot\WebApp\appsettings.json";
PowerShell Service enable/disable procedure
# Get service status:
Get-Service -ComputerName serverone.local.co.za -Name ServiceName

# Restart service:
Get-Service -ComputerName serverone.local.co.za -Name ServiceName | Restart-Service -Force

# Stop service:
Get-Service -ComputerName serverone.local.co.za -Name ServiceName | Stop-Service -Force

# Start service:
Get-Service -ComputerName serverone.local.co.za -Name ServiceName | Start-Service
PowerShell Various Commands
  • Converting text to base64 in PowerShell:
# $text = "<text>";
# $bytes = [System.Text.Encoding]::UTF8.GetBytes($text);
# $base64 = [Convert]::ToBase64String($bytes);
# Write-Output $base64;
	
$text = "<text>"; $base64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($text)); Write-Output $base64;
  • Get all file names in a folder, excluding their extensions, and output them as a comma-separated list
$folderPath = "C:\Your\Folder\Path";
$fileNames = Get-ChildItem -Path $folderPath -File | Select-Object -ExpandProperty BaseName;
$commaList = $fileNames -join ",";
Write-Output $commaList;
Scheduling a batch file to run with Windows Task Scheduler is a great way to automate tasks on your PC

Here's a step-by-step guide to help you set it up:

  1. Create Your Batch File: Make sure you have your batch file (.bat) ready and stored in a safe location on your PC. The location is important because if the file is moved or deleted, the task will not run.

  2. Open Task Scheduler:

    • Press Win + R to open the Run dialog box.
    • Type taskschd.msc and press Enter. This will open the Task Scheduler.
  3. Create a New Task:

    • In the Task Scheduler window, click on Action in the menu bar and select Create Basic Task.
    • Give your task a name and description that will help you recognize it later. Click Next.
  4. Set the Trigger:

    • Choose when you want the task to start. You have several options such as Daily, Weekly, Monthly, One time, When the computer starts, When I log on, or When a specific event is logged. Select the option that best suits your needs and click Next.
  5. Set the Action:

    • Choose Start a program and click Next.
    • Click Browse and navigate to the location of your batch file. Select the batch file and click Open.
  6. Finish the Task:

    • Review the summary of your task and click Finish to create the task.
  7. Run with Admin Rights (Optional):

    • If your batch file requires administrative privileges, find the task in the Task Scheduler, right-click on it, and select Properties.
    • Go to the General tab and check the box that says Run with highest privileges. Click OK.

That's it! Your batch file should now run according to the schedule you set.

Various Documentation

Various Documentation

Prompts for AI Agent

Prompt rephrase template

  • Please rephrase the following using professional business language: '[Your Text Here]'.
  • Rephrase the following technical requirement, deliver the output as a one-liner/single paragraph: '[Your Text Here]'.
  • Please refine the grammar and phrasing of the following text while maintaining the original context and striking a professional yet approachable balance between a casual and diplomatic tone.
  • Rephrase the following technical requirement for [Target Audience]: '[Your Text Here]', focusing on [Clarity/Professionalism/Technical Detail] and deliver the output as a [one-liner/single paragraph].
  • Develop a high-performance, editable '[ComponentTypeName]' component with two-way data binding and integrate it into the existing Form Ecosystem (Editor and Renderer), ensuring all existing and unused variables are preserved within the schema.
  • Please summarize the following text into a concise narrative. Refine the grammar and phrasing to ensure the tone is professional yet approachable - striking a balance between casual and diplomatic. Ensure the original context remains intact while improving clarity and flow.
  • Provide a one-liner or short paragraph summary of the following text in 255 characters or less. Use a professional but approachable tone that is both casual and diplomatic. Focus on high-level impact and ensure the grammar is polished.

Debugging

  • Identify root cause of null reference exception in [file/class/method].
  • Trace performance bottleneck in [function/module] and suggest optimizations.
  • Detect memory leaks in [component/service].
  • Analyze incorrect output in [algorithm/function] and propose fix.
  • Locate unhandled exceptions in [workflow/process].

Refactoring

  • Refactor [class/module] to improve readability and maintainability.
  • Extract reusable methods from [function/block].
  • Simplify nested conditionals in [method/function].
  • Convert procedural code in [file] to object-oriented design.
  • Replace duplicated logic in [modules] with shared utility.

Code Feature Generation – OOP and Data-Driven

  • Generate new class [ClassName] implementing [Interface/BaseClass].
  • Create data-driven service for [entity] with CRUD operations.
  • Implement repository pattern for [database/entity].
  • Add unit tests for [class/method] using [framework].
  • Generate DTOs for [entity] with mapping from domain models.

MVVM

  • Create ViewModel for [UI component] with observable properties.
  • Bind ViewModel commands to [UI control] actions.
  • Implement data validation in [ViewModel].
  • Generate model class for [entity] with property change notifications.
  • Connect ViewModel to [service/repository] for data retrieval.

UI Controls Generation with Data Binding

  • Generate data-bound list control for [entity collection].
  • Create form with two-way binding to [ViewModel].
  • Implement dynamic dropdown bound to [data source].
  • Add grid control with sorting and filtering bound to [collection].
  • Generate reusable custom control with dependency properties.

Common Boilerplate

  • Create configuration file template for [environment].
  • Generate logging setup for [application/service].
  • Add authentication middleware boilerplate for [framework].
  • Create unit test project structure for [solution].
  • Generate API controller template for [entity/resource].
Common Documentation
  • To preview Markdown in VS Code:

    • Using Command Palette (Ctrl/Cmd + Shift + P)
    • Type these commands to trigger the preview:
      • To Side: Type Markdown: Open Preview to the Side
      • Full Tab: Type Markdown: Open Preview
  • To enable the Open Editors panel in Visual Studio Code, here's how you can bring it back if it's hidden:

    • Steps to Enable "Open Editors" in VS Code

      • Via the View Menu:
      1. Go to the top menu bar and click View.
      2. Select Open View....
      3. Scroll down and click Open Editors.
      • From the Explorer Sidebar:
      1. Open the Explorer side panel.
      2. Click the three-dot menu (⋮) in the top-right corner of the panel.
      3. Make sure Open Editors is checked.
      • Using Settings:
      1. Open Settings (Ctrl+, or Cmd+,).
      2. Search for explorer.openEditors.visible.
      3. Set the value to any number greater than 0 to make it visible.
    • If you’ve accidentally moved or hidden it, you can also right-click the Activity Bar and look for options to reset or relocate the panel.

Command Documentation
  • Windows Temp Folder: %temp%

  • Podman CLI:

# Start service
podman machine start
# Start all projects
podman compose -f compose.dev.yml up
# Start specific project
podman compose -f compose.dev.yml up <project-name>
# Remove container for specific project
podman compose -f compose.dev.yml down <project-name>
# Build container for specific project
podman compose -f compose.dev.yml build <project-name> --no-cache
# Stop service
podman machine stop
  • Launch LLM locally with Ollama CL:
ollama serve # Access server at http://localhost:11434/
# Pass the prompt as an argument
ollama run deepseek-coder:6.7b "Write a TypeScript function that adds two numbers."
# Start the Open WebUI server
open-webui serve --host 192.168.1.102 --port 8080 # Access server at http://192.168.1.102:8080/
# Generate Git commit message, use the Continue extension command @Git Diff to send the git diff to your local LLM.
#   @Git Diff Write a simple commit message summarizing the modifications
  • Converting text to base64 in CMD:
@echo off
setlocal enabledelayedexpansion

set "text=<text>"
echo !text! | openssl base64
  • Clear macOS user-level caches:
rm -rf ~/Library/Caches/*
  • CMD: Convert MP4 to AVI
ffmpeg -i input.mp4 output.avi
  • CMD: Unquarantine and unzip via Terminal (macOS)
# When you download files from the internet, macOS attaches a "quarantine" attribute to them as a security measure. 
# This can sometimes cause scripts or apps inside a zip to fail when you try to run them after unzipping.
# Here is the most efficient way to handle both in one go via Terminal.
xattr -d com.apple.quarantine file.zip && unzip file.zip
  • CMD: Convert all WAV files in a folder to MP3 format using FFmpeg
for i in *.wav; do ffmpeg -i "$i" -f mp3 "${i%.*}.mp3"; done
  • CMD: Convert MP4 to GIF
ffmpeg -i input.mp4 -vf "fps=10,scale=1920:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i input.mp4 -i palette.png -filter_complex "fps=10,scale=1920:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
  • Check Battery Health in Windows
powercfg /batteryreport
  • OpenStreetMap API
# To get an address from coordinates using OpenStreetMap:
curl "https://nominatim.openstreetmap.org/reverse?lat=-25.754511453940673&lon=28.181179918201046&format=json"
	
# To get coordinates from address using OpenStreetMap: 
curl "https://nominatim.openstreetmap.org/search?q=Herman+Road,+Germiston,+South+Africa&format=jsonv2"
  • Open Windows System Environment Variables
Windows + R > SystemPropertiesAdvanced > Environment Variables
  • Stopping AzAgent:
End task: Agent.Listener.exe / AzAgent.Listener.exe
End task: AgentService.exe / AzAgentService.exe
  • See All Machines on the Network (LAN - macOS):
arp -a
  • If adb is not recognized, you may need to add the SDK platform-tools to your path (macOS):
export PATH=$PATH:~/Library/Android/sdk/platform-tools
  • Podcast episodes downloaded via the Apple Podcasts app are stored in a hidden system folder (macOS):
~/Library/Group Containers/243LU875E5.groups.com.apple.podcasts/Library/Cache
  • Visual Studio Code to transform text case:

    • Select the text you want to change.
    • Press Ctrl + Shift + P (or Cmd + Shift + P on macOS) to open the Command Palette.
    • Type Transform to and choose:
      • Transform to Uppercase
      • Transform to Lowercase
      • Transform to Titlecase
  • Visual Studio Code Find and Regex Examples:

    • To find any usage of MyClass.<property> and replace it with await new MyClass().<property>() in Visual Studio Code using regex-based search and replace.

      • Regex Search Pattern
      • \b ensures word boundaries so it doesn’t match partial words.
      • MyClass\. matches the literal MyClass..
      • (\w+) captures the property name (like PropOne, PropTwo, etc.).
      • The parentheses () create a capture group for reuse in the replacement.
      \bMyClass\.(\w+)\b
      • Replacement Pattern
      • $1 refers to the captured property name.
      • Appends () to treat it like a method call.
      await new MyClass().$1()
      
    • To handle the more complex case of MyClass.Property.ChildProperty and transform it into (await new MyClass().Property()).ChildProperty, you’ll need a regex that captures both parts of the property chain.

      • Regex Search Pattern
      \bMyClass\.(\w+)\.(\w+)\b
      \(await\s+new\s+MyClass\(\)\.\w+\(\)\)
      
      • Replacement Pattern
      (await new MyClass().$1()).$2
      
    • To find: (await new MyClass().Property()) or (await new MyClass().Property()).ChildProperty

      • Regex Search Patterns
      \(await\s+new\s+MyClass\(\)\.\w+\(\)\)
      \(await\s+new\s+MyClass\(\)\.\w+\(\)\)\.\w+
      
    • To add a comma at the end of each line in Visual Studio Code using regular expressions, follow these steps:

      • Use this regex pattern in the Find box:
       (.+)$
      
      • Use this in the Replace box:
       $1,
      
    • Regex pattern used in a multiline search context:

      • Multiline Find: Shift+Enter in the Search Panel
      • Multiline Find: Use (.*\n)+ to match one or more lines with or without content, .e.g, <html>(.*\n)+</html> for an entire document.
    • Replace all newlines with spaces:

      1. Open the Find and Replace Dialog:
        • Press Ctrl + H to open the Find and Replace dialog.
      2. Set Up the Find and Replace:
        • In the "Find what" box, enter \n to match newlines.
        • In the "Replace with" box, enter a space to replace newlines with a space.
      3. Enable Regular Expressions:
        • Click on the "Use Regular Expressions" option (usually a button with a star or asterisk symbol .*).
      4. Perform the Replacement:
        • Click "Replace All" to replace all newlines with spaces. Here's a visual representation of what you need to do:
      • Find what: \n OR ^(?:[\t]*(?:\r?\n|\r))+
      • Replace with: (a single space)
      • Use Regular Expressions: Enabled
    • Remove comments from your code in Visual Studio, you can use the following steps:

      1. Open your code file** in Visual Studio.
      2. Select the lines** of code that contain the comments you want to remove.
      3. Use the "Find and Replace" feature**:
        • Press Ctrl + H to open the Find and Replace window.
        • In the "Find what" box, enter the comment syntax for your programming language (e.g., // for single-line comments in C#, /* ... */ for block comments).
        • Leave the "Replace with" box empty.
        • Click on "Replace All" to remove all instances of the comment syntax.
      • Alternatively, you can use regular expressions in the Find and Replace window to target comments more precisely. For example, to remove single-line comments in C#, you can use the following regular expression in the "Find what" box: //.*$.
MySQL Common Commands
  • Community Server 9.5.0 Innovation macOS ARM Command-Line Usage

  • To avoid typing full paths, add this to your shell profile (~/.zshrc or ~/.bash_profile):

# Open your .zshrc file in a text editor
open ~/.zshrc # This will open the file in your default text editor (usually TextEdit on macOS)
# Add the following lines at the bottom of the file
export PATH=/usr/local/mysql-9.5.0-macos15-arm64/bin:$PATH
# Save and close the file
# Apply the changes
source ~/.zshrc
Command Purpose Example
mysql Start the MySQL client (interactive shell) mysql -u root -p
mysqld Start the MySQL server daemon manually mysqld --defaults-file=/usr/local/mysql/my.cnf
mysqld_safe Wrapper to start server with safety checks mysqld_safe --user=mysql &
mysqladmin Administrative tasks (shutdown, status, etc.) mysqladmin -u root -p shutdown
mysqldump Export databases/tables to SQL dump mysqldump -u root -p mydb > mydb.sql
mysqlimport Import data from text files mysqlimport -u root -p mydb data.txt
mysqlshow Show databases/tables quickly mysqlshow -u root -p
SHOW DATABASES; Show databases/tables quickly mysql -u root -p -e "SHOW DATABASES;"
mysqlcheck Check/repair/optimize tables mysqlcheck -u root -p --all-databases
exit; or quit; or Ctrl + D Closing your session with the server Run inside the MySQL Shell
  • On macOS, the MySQL Preference Pane is a small control panel that gets installed when you use the official Oracle .dmg installer. Enable the auto‑start option inside that pane so MySQL always runs when you log in, without needing to click start each time. Here’s exactly where to look: System Settings > Scroll down the left sidebar to MySQL.
# Check the folder directly:
ls /Library/PreferencePanes | grep MySQL
#If installed, you’ll see something like:
MySQL.prefPane
NodeJS Common Commands
  • To install a package, use the npm install command followed by the package name. This command installs the package and adds it to the node_modules directory.

    • npm install <package-name>
  • For example, to install the Express package, you would run:

    • npm install express
  • To install a package globally, use the -g flag:

    • npm install -g <package-name>
    • npm install -g @angular/cli
    • npm install -g azure-functions-core-tools
  • To remove a package, use the npm uninstall command followed by the package name:

    • npm uninstall <package-name>
  • For example, to uninstall the Express package, you would run:

    • npm uninstall express
  • To uninstall a global package, use the -g flag:

    • npm uninstall -g <package-name>
  • To update a package, use the npm update command followed by the package name:

    • npm update <package-name>
  • For example, to update the Express package, you would run:

    • npm update express
  • To update all global packages, use the -g flag:

    • npm update -g
  • To list all installed packages, use the npm list command:

    • npm list
  • To list all globally installed packages, use the -g flag:

    • npm list -g
  • To check for outdated packages, use the npm outdated command:

    • npm outdated
  • To check for outdated global packages, use the -g flag:

    • npm outdated -g
  • To run a script defined in the package.json file, use the npm run command followed by the script name:

    • npm run <script-name>
  • For example, to run a script named start, you would run:

    • npm run start
  • To publish a package to the npm registry, use the npm publish command:

    • npm publish
  • Additional Commands:

    • npm init: Create a package.json file.
    • npm test: Run tests defined in the package.json file.
    • npm version: Bump the version of a package.
    • npm help: Get help on npm commands.
Azure Application Insights

Azure Application Insights

Azure Application Insights Information

To show the average response time in milliseconds (ms) or in 1-minute intervals, you can adjust the KQL query accordingly. Here are the two options:

1. Average Response Time in Milliseconds (ms):

requests
| where timestamp >= ago(3d)
| summarize avgDurationMs = avg(duration) by bin(timestamp, 1d)
| project Day = format_datetime(bin(timestamp, 1d), 'yyyy-MM-dd'), avgDurationMs

2. Average Response Time in 1-Minute Intervals:

requests
| where timestamp >= ago(3d)
| summarize avgDuration = avg(duration) by bin(timestamp, 1m)
| project Minute = format_datetime(bin(timestamp, 1m), 'yyyy-MM-dd HH:mm'), avgDuration

3. Maximum Response Time in Milliseconds (ms):

requests
| where timestamp >= ago(3d)
| summarize maxDurationMs = max(duration) by bin(timestamp, 1d)
| project Day = format_datetime(bin(timestamp, 1d), 'yyyy-MM-dd'), maxDurationMs

You can run these KQL queries in the Azure Portal using the Log Analytics feature within your Application Insights resource. Here are the steps:

  1. Open Azure Portal: Navigate to the Azure portal.
  2. Select Application Insights: Go to your Application Insights resource.
  3. Open Logs (Analytics): In the left-hand menu, select "Logs" under the "Monitoring" section.
  4. Enter Your Query: Copy and paste the KQL query into the query editor.
  5. Run the Query: Click the "Run" button to execute the query and view the results.

This will allow you to analyze the average response time for requests over the last 3 days.

To check the average response time for requests in the last 3 days using Azure Application Insights, you can follow these steps:

  1. Open Azure Portal: Navigate to the Azure portal and select your Application Insights resource.
  2. Go to Metrics: In the Application Insights resource, go to the "Metrics" section.
  3. Configure Metrics:
    • Select "Log-based metrics" as the metric namespace.
    • Choose "Receiving response time" as the metric.
    • Select "Average" as the aggregation type.
    • Set the time range to the last 3 days.
  4. Apply Filters: If needed, apply any additional filters to narrow down the data to specific requests or operations.
  5. View Results: The chart will display the average response time for the selected period.
Build and Test PHP 7 CRUD REST API with MySQL

Build and Test PHP 7 CRUD REST API with MySQL:

Microsoft Visual Studio Installer Projects

Microsoft Visual Studio Installer Projects:

Nexuses

Nexuses:

Nexuse
Quick Links

Quick Links

FiddlerSetup.exe

https://1drv.ms/u/s!AhZQXd4hLlaXrj4l14lf0TOmtJtW?e=dKxl7g

TinyWall Settings

https://1drv.ms/u/s!AhZQXd4hLlaXrj8TmAkMFlT8_DyC?e=49udoH

Spoof Location on Microsoft Edge

Custom IIS Domain Name Config

  • C:\Windows\System32\drivers\etc\hosts
  • localhost name resolution is handled within DNS itself.
  • 27.0.0.1       www.localhost.com

How to Host PHP on Windows With IIS

https://stackify.com/how-to-host-php-on-windows-with-iis/

Git Essentials

Git Essentials

Here is a comprehensive list of common Git commands for your daily workflow on macOS.

Git Essentials Cheat Sheet

Category Command Description
Setup & Auth git clone <url> Downloads a repository to your Mac.
git config --global user.name "Name" Sets your commit name.
git config --global user.email "email" Sets your commit email.
git remote v Lists the remote URLs (useful for checking auth/origin).
Daily Flow git status Shows changed files and current branch.
git add . Stages all changes for the next commit.
git commit -m "message" Commits staged changes with a descriptive note.
git push origin <branch> Uploads local commits to Azure DevOps.
git pull Fetches and merges changes from the remote.
Branches git checkout -b <name> Creates a new branch and switches to it.
git switch <name> Switches to an existing branch.
git branch -a Lists all local and remote branches.
Conflicts git merge <branch> Merges another branch into your current one.
git diff Shows specific line changes causing conflicts.
git merge --abort Cancels the merge if conflicts are too messy.
Advanced git cherry-pick <commit-hash> Applies a specific commit from another branch.
git stash Temporarily hides changes to work on something else.
git stash pop Brings back your hidden changes.
git log --oneline Shows a condensed history of commits.

Handling Pull Requests (PRs) via Terminal

While most people complete PRs in the Azure DevOps web UI, you can manage the local side via the terminal:

  1. Prepare your branch: git push origin feature-branch
  2. Azure DevOps CLI: If you install the Azure CLI (brew install azure-cli) and the DevOps extension, you can create a PR directly:
    • az repos pr create --target-branch main

Dealing with Authentication & Conflicts

  • Authentication: On macOS, Git usually uses the Apple Keychain. If you get an authentication error after changing your password or PAT, run:
    • git config --global credential.helper osxkeychain
  • Merge Conflicts: When a conflict occurs, VS Code will highlight the files in red.
    • Open the file in VS Code.
    • Use the "Merge Editor" button at the bottom right.
    • Accept "Current," "Incoming," or "Both" changes, then git add and git commit to finish.
Agent Global Skill Setup

Agent Global Skill Setup

This consolidated setup ensures compatibility across both GitHub Copilot (VS Code/Visual Studio) and Google AntiGravity. By utilizing the .agents and .github directories effectively, you provide a unified source of truth for all AI-assisted development.

1. Unified Folder Tree

This structure ensures that regardless of the IDE or Agent being used, the logic remains centralized.

MySolution/
├── .agents/                      <-- Google AntiGravity Root
│   ├── rules/
│   │   └── global-rules.md       <-- System Instructions
│   └── skills/
│       ├── project-expert.md     <-- Logic/Architecture
│       └── design-system.md      <-- UI/UX Standards
└── .github/                      <-- GitHub Copilot Root
    ├── copilot-instructions.md    <-- Symlink or Copy of global-rules.md
    └── skills/                   <-- Symlink or Copy of .agents/skills/

2. Global Rules: .agents/rules/global-rules.md

(Also used as copilot-instructions.md)

# Global Instructions
Use these rules for all development tasks within this workspace.

## Engineering Standards
- Framework: .NET 9+ / C# 13.
- Pattern: Clean Architecture with strict separation of concerns.
- Async: Use asynchronous patterns for all I/O operations.
- UI: Use MudBlazor components following the established Design System.

## Agent Behavior
- Prioritize scannable code with concise comments.
- Reference the specific Skills directory when handling UI or complex logic.

3. Logic Skill: .agents/skills/project-expert.md

---
name: ProjectExpert
description: Use this skill for .NET development, MudBlazor logic, and architecture patterns.
---
# Project Logic Skills

## Backend Patterns
- Use Result patterns for service responses.
- Implement Dependency Injection for all service layers.

## MudBlazor Integration
- Use MudDialogService for all modals.
- Implement Repository patterns for data access behind components.

4. Design Skill: .agents/skills/design-system.md

---
name: DesignSystemExpert
description: Use this skill for UI/UX styling, theme variables, and MudBlazor component consistency.
---
# Design System Context

## Visual Identity
- Primary Color: #594AE2
- Secondary Color: #FF4081
- Theme: Support Light and Dark modes via MudTheme.

## Layout and Components
- Grid: 12-column system, 4px spacing increments.
- Buttons: Use Variant.Filled for primary actions.
- Icons: Use Material.Filled icons exclusively.
- Forms: Use Margin.Dense and top-aligned labels.

## Typography
- Headings: Montserrat.
- Body: Open Sans (14px base).

5. Setup and Implementation

For Google AntiGravity Users:

  • Directory: AntiGravity automatically indexes the .agents/ folder.
  • Grounding: The agent uses the YAML description to determine when to "load" the DesignSystemExpert or ProjectExpert into its active context window.
  • Manual Call: Use the @ symbol to explicitly mention a skill if the agent requires a nudge (e.g., "Refactor this using @DesignSystemExpert").

For VS Code / GitHub Copilot Users:

  • Directory: Copilot looks for .github/copilot-instructions.md and the .github/skills/ folder.
  • Context Efficiency: By keeping technical details in the skills/ files, you save token space in the main instructions, ensuring faster and more relevant responses.
  • Verification: Ask the chat, "What skills do you have access to?" to confirm ProjectExpert and DesignSystemExpert are indexed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment