-
Install the AI Web Chat template:
dotnet new install Microsoft.Extensions.AI.Templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # jump-utils.zsh - Lightweight directory jump utilities for Zsh | |
| # Ported from: https://gist.github.com/jongalloway/332c3b15d2557dfa71575b79713ffbf1 | |
| # | |
| # Quick install - add to your ~/.zshrc: | |
| # [[ -f ~/.jump-utils.zsh ]] && source ~/.jump-utils.zsh | |
| # | |
| # Usage: | |
| # repo <name> - pushd to a repo (supports partial match + tab completion) | |
| # repo list - list all repos | |
| # repo - pushd to repo root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # jump-utils.ps1 - Lightweight directory jump utilities for PowerShell | |
| # https://gist.github.com/jongalloway/332c3b15d2557dfa71575b79713ffbf1 | |
| # | |
| # Quick install - add this to your PowerShell profile (code $PROFILE): | |
| # iwr "https://gist.githubusercontent.com/jongalloway/332c3b15d2557dfa71575b79713ffbf1/raw/jump-utils.ps1" -OutF "$(Split-Path $PROFILE)\jump-utils.ps1" | |
| # Add-Content $PROFILE '. (Join-Path (Split-Path $PROFILE) "jump-utils.ps1")' | |
| # | |
| # Or manually: | |
| # 1. Save this file next to your profile (Split-Path $PROFILE) | |
| # 2. Add to your PowerShell profile: . (Join-Path (Split-Path $PROFILE) "jump-utils.ps1") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Setup GitHub Copilot Windows Terminal Profile | |
| # Run: irm <gist-raw-url> | iex | |
| $ErrorActionPreference = "Stop" | |
| function Write-Step([string]$Message) { | |
| Write-Host "[OK] $Message" | |
| } | |
| # 0. Choose the best Copilot command available |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (async () => { | |
| function simulateSliderDrag(sliderHandle, targetValue, defaultValue) { | |
| const track = sliderHandle.closest('.rc-slider'); | |
| if (!track) return; | |
| const trackRect = track.getBoundingClientRect(); | |
| const totalPixels = trackRect.width; | |
| const deltaUnits = targetValue - defaultValue; | |
| const deltaPixels = (deltaUnits / 100) * totalPixels; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /********************************* Module Header **********************************\ | |
| * Module Name: DataGridViewPaging | |
| * Project: CSWinFormDataGridView | |
| * Copyright (c) Microsoft Corporation. | |
| * | |
| * This sample demonstrates how to page data in the DataGridView control; | |
| \**********************************************************************************/ | |
| #region Using directives | |
| using System; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Define the dev drive letter and resizing percentage | |
| $devDriveLetter = "D" | |
| $resizePercentage = 10 # Set the percentage increase (e.g., 10%) | |
| # Find the VHDX file associated with the dev drive | |
| $mountedVHDs = Get-VHD | Where-Object -Property FileType -EQ "VHDX" | Where-Object -Property Attached -EQ $true | |
| $devDriveVHD = $mountedVHDs | Where-Object { | |
| $disk = Get-DiskImage -Path $_.Path | Get-Disk | Where-Object IsOffline -EQ $false | |
| $partition = Get-Partition -DiskNumber $disk.Number | Where-Object DriveLetter -EQ $devDriveLetter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| // Manually set x and y values for text elements since calculation isn't reliable. Set to what works for your theme. | |
| const textX = 0; | |
| const textY = 17; | |
| // Optional feature to insert a white rectangle below the diagram for dark mode visibility | |
| const addBackgroundRect = false; | |
| // Get the SVG element | |
| const svg = document.querySelector('svg'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Extensions.Logging; | |
| using Microsoft.SemanticKernel; | |
| using Microsoft.SemanticKernel.AI.ChatCompletion; | |
| using Microsoft.SemanticKernel.Memory; | |
| using System.Text; | |
| string aoaiEndpoint = Environment.GetEnvironmentVariable("AZUREOPENAI_ENDPOINT")!; | |
| string aoaiApiKey = Environment.GetEnvironmentVariable("AZUREOPENAI_API_KEY")!; | |
| string gptModelDeploymentName = Environment.GetEnvironmentVariable("AZUREOPENAI_GPT_NAME")!; | |
| string adaTextDeploymentName = Environment.GetEnvironmentVariable("AZUREOPENAI_TEXT_EMBEDDING_NAME")!; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var https = require('https'), | |
| user = process.argv[2], | |
| opts = parseOpts(process.argv.slice(3)) | |
| request('/users/' + user, function (res) { | |
| if (!res.public_repos) { | |
| console.log(res.message) | |
| return | |
| } | |
| var pages = Math.ceil(res.public_repos / 100), |
NewerOlder