Consectetur laboris ut adipisicing culpa id occaecat cupidatat eiusmod fugiat velit.
Consectetur laboris ut adipisicing culpa id occaecat cupidatat eiusmod fugiat velit.
| #!/usr/bin/env bash | |
| limit=1500 | |
| USER=$(gh api user -q .login) | |
| response=$(gh api -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| "/users/$USER/settings/billing/premium_request/usage?year=$(date +%Y)&month=$(date +%-m)") | |
| used=$(jq '[.usageItems[] | select(.sku=="Copilot Premium Request") | .grossQuantity] | add' <<< "$response") | |
| pct=$(awk "BEGIN {printf \"%.2f\", ($used/$limit)*100}") | |
| echo "Copilot Premium Requests: $used / $limit used ($pct%)" |
Okay, to mass git pull or update folders in the first level of your current directory using PowerShell on Windows, you can use a foreach loop. Here's the command:
Get-ChildItem -Directory | ForEach-Object {
if (Test-Path -Path "$($_.FullName)\.git") {
Write-Host "Pulling changes in $($_.Name)..."
Push-Location $_.FullName
git pull
Pop-Location
} else {| # Array of application IDs | |
| $apps = @( | |
| "Obsidian.Obsidian", | |
| "junegunn.fzf", | |
| "Nilesoft.Shell", | |
| "Wazuh.WazuhAgent", | |
| "TechPowerUp.GPU-Z", | |
| "KDE.KDEConnect", | |
| "GitHub.cli", | |
| "Gyan.FFmpeg", |
| [ | |
| { | |
| "key": "ctrl+alt+b", | |
| "command": "workbench.action.toggleAuxiliaryBar", | |
| "title": "View: Toggle Secondary Side Bar Visibility", | |
| "source": "system" | |
| }, | |
| { | |
| "key": "ctrl+b", | |
| "command": "workbench.action.toggleSidebarVisibility", |
| git fetch --prune --all -v && \ | |
| git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -I {} git branch -D {} 2>/dev/null && \ | |
| git remote prune origin && \ | |
| for b in $(git branch -r | tr '/' ' '); do | |
| if [ "$b" != "HEAD" ]; then | |
| git checkout "${b#origin/}" && git pull; | |
| fi; | |
| done |
| "workbench.colorCustomizations": { | |
| // Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast. | |
| "contrastActiveBorder": "", | |
| "contrastBorder": "", | |
| // Base Colors | |
| "focusBorder": "", | |
| "foreground": "", | |
| "widget.shadow": "", | |
| "selection.background": "", | |
| "descriptionForeground": "", |
| function Get-AvailableUpdates { | |
| [CmdletBinding()] | |
| Param() | |
| Write-Host "Initializing Windows Update session..." | |
| $wu_session = New-Object -ComObject Microsoft.Update.Session | |
| $wu_searcher = $wu_session.CreateUpdateSearcher() | |
| Write-Host "Searching for available updates..." | |
| $updates = $wu_searcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0") |
| $ErrorActionPreference = "Continue" | |
| $ProgressPreference = "Continue" | |
| function Install-WingetAndPowerShell { | |
| try { | |
| Write-Host "[+] Installing Winget and PowerShell..." -ForegroundColor Yellow | |
| # Install Winget | |
| Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe | |
| Write-Host "Winget installed" |