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
| // ==UserScript== | |
| // @name Instagram Quick Actions | |
| // @namespace https://www.instagram.com/ | |
| // @version 0.6.3 | |
| // @description Adds "Not Interested" and "Block Account" shortcut buttons to every Instagram feed post. | |
| // @match https://www.instagram.com/* | |
| // @run-at document-idle | |
| // @grant none | |
| // ==/UserScript== |
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
| // ==UserScript== | |
| // @name URL Clean | |
| // @namespace https://github.com/ | |
| // @version 0.1.7 | |
| // @description Cleans safe tracking parameters and known redirect wrappers on an allowlisted set of video, shopping, search, and social sites. | |
| // @match https://*.youtube.com/* | |
| // @match https://youtu.be/* | |
| // @match https://*.twitter.com/* | |
| // @match https://x.com/* | |
| // @match https://*.facebook.com/* |
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
| """ | |
| BYOK (Bring Your Own Key) demo for the GitHub Copilot SDK. | |
| Sends a single prompt to any OpenAI-compatible endpoint — local Ollama, OpenAI, | |
| Azure OpenAI, or any other compatible API — using the Copilot SDK session API. | |
| Usage | |
| ----- | |
| # Local Ollama (default, no key required) | |
| uv run byok.py --prompt "Tell me a joke" |
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 Set-MonitorInputSource { | |
| <# | |
| .SYNOPSIS | |
| Helper function to set the monitor state. | |
| .EXAMPLE Switch to HDMI | |
| Set-MonitorInputSource -InputSource HDMI | |
| .EXAMPLE Switch to DisplayPort | |
| Set-MonitorInputSource -InputSource DisplayPort |
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 Convert-FromAppActivityReport { | |
| <# | |
| .SYNOPSIS | |
| Helper function to convert the iOS app activity report into custom objects | |
| https://developer.apple.com/documentation/foundation/urlrequest/inspecting_app_activity_data | |
| .EXAMPLE | |
| Get apps accessed iOS resources | |
| Convert-FromAppActivityReport -Path $path -Type access | Select-Object accessor_id -Unique |
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 Set-TaskbarIconSize { | |
| # Sets the windows 11 task bar icon size. Default value is medium. | |
| [CmdletBinding()] | |
| param( | |
| [validateset("small", "medium", "large")] | |
| [string]$Size = "medium" | |
| ) | |
| $sizeChart = @{ | |
| "small" = 0 | |
| "medium" = 1 |
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
| Describe 'Pre-meeting Check List' { # These are a Pester 5 compliant tests. | |
| Context 'Device Check' { | |
| It 'Device should be present and have OK status: [<deviceName>]' -TestCases @( | |
| @{deviceName = 'Blue Snowball' } | |
| @{deviceName = '*TrackBall Mouse' } | |
| @{deviceName = 'Microphone (Blue Snowball)' } | |
| @{deviceName = 'Canon EOS 6D Mark II' } | |
| ) { | |
| $device = (Get-PnpDevice -FriendlyName $deviceName -Status 'OK' -PresentOnly -ErrorAction SilentlyContinue) | |
| $device.count | Should -BeGreaterOrEqual 1 |
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
| Describe 'Unit testing the helper functions in self contained script' { | |
| BeforeAll { | |
| # Using AST to parse the function definitions from the self contained script. | |
| # Then, save the script of the Pester test drive. | |
| $FilePath = Join-Path -Path '.' -ChildPath 'ScriptWithFunction.ps1' | |
| $ast = [System.Management.Automation.Language.Parser]::ParseFile($FilePath, [ref]$null, [ref]$null) | |
| $functionDefinition = $ast.FindAll( { | |
| param([System.Management.Automation.Language.Ast] $AstInput) | |
| $AstInput -is [System.Management.Automation.Language.FunctionDefinitionAst] -and | |
| # Class methods have a FunctionDefinitionAst under them as well, but we don't want them. |
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
| # https://twitter.com/dfinke/status/1167559940598370304 | |
| function Get-Exponent { | |
| param( | |
| [int]$Base, | |
| [int]$Power | |
| ) | |
| $exponent = [Math]::Pow($Base, $Power) | |
| $exponent | |
| } | |
| function Get-OneSeries { |
NewerOlder