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 Select-Button { | |
param( | |
[string]$Prompt, | |
[string[]]$Buttons, | |
[uint]$Position | |
) | |
"$Prompt " | Write-Host -NoNewline -ForegroundColor Magenta | |
$cursor = $Host.UI.RawUI.CursorPosition | |
$Panel = { | |
$panel_ = '' |
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
Clear-Host | |
$host.ui.RawUI.WindowTitle = "JPEG Optimizer" | |
[Console]::CursorVisible = $false | |
$Host.PrivateData.ProgressBackgroundColor = "Gray" | |
$Host.PrivateData.ProgressForegroundColor = "Black" | |
Class ResultItem { | |
[string]$Name | |
[string]$Files_processed | |
[string]$Size_MB |
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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory, ValueFromPipeline, Position = 0)] | |
[ValidatePattern('\.wav$', ErrorMessage = "You should specify .wav files")] | |
[string[]]$Input, | |
[Parameter(Position = 1)][Alias('p')] | |
[uint]$Passes = 10 | |
) | |
process { | |
Class Result { |
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
# params | |
[CmdletBinding(DefaultParameterSetName="Casual")] | |
param ( | |
[Alias("c")] | |
[Parameter(ParameterSetName = "Pro", Mandatory = $true)] | |
[ValidateSet("stable", "beta", "dev", "canary")] | |
[string]$Channel, | |
[Alias("v")] | |
[Parameter(ParameterSetName = "Pro", Mandatory = $true)] | |
[ValidateNotNullOrEmpty()] |
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
$downloadpath = "D:\Downloads" | |
$curversion = (Get-Content -Path "resources\app\package.json" | ConvertFrom-Json).version | |
$newversion = (Invoke-WebRequest -Uri "https://api.github.com/repos/microsoft/vscode/releases/latest" | ConvertFrom-Json).tag_name | |
Write-Host "Visual Studio Code - Updater" -ForegroundColor Cyan | |
Write-Host "Current version: " -NoNewLine | |
Write-Host $curversion -ForegroundColor Yellow | |
Write-Host "New version: " -NoNewLine | |
Write-Host $newversion -ForegroundColor Green | |
$choice = Read-Host -Prompt "Type 'y' or 'yes' to update current version" | |
If (-not ($choice.ToLower() -in @("y", "yes"))) { exit } |
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
Set-Location $PSScriptRoot | |
$tJson = .\smartctl.exe -j -A /dev/sda | ConvertFrom-Json | |
$totallba = ($tJson.ata_smart_attributes.table | where { $_.id -eq 241 }).raw.value | |
$lasttlba = Get-Content -Path "last" | |
$inGB = ([Math]::Round($totallba * 512 / 1GB, 2)).ToString("0.00") | |
$diff = ([Math]::Round(($totallba - $lasttlba) * 512 / 1MB, 2)).ToString("0.00") | |
$curDT = (Get-Date -Format "yyyy/MM/dd HH:mm:ss") |
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
$null = [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | |
$null = [Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | |
$Title = "Test" | |
$Message = "Test" | |
$XmlString = @" | |
<toast> | |
<visual> | |
<binding template="ToastGeneric"> |
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
$shell = New-Object -comObject WScript.Shell | |
$shortcut = $shell.CreateShortcut("$PSScriptRoot\Google Chrome.lnk") | |
$shortcut.TargetPath = "$PSScriptRoot\app\chrome.exe" | |
$shortcut.WorkingDirectory = "$PSScriptRoot\app" | |
$shortcut.Arguments = ( | |
'--user-data-dir=Z:\ChromeData', | |
'--disk-cache-size=104857600', | |
'--disable-component-update', | |
'--disable-default-apps', | |
'--disable-sync', |
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
#!/bin/bash | |
while getopts 'csajpeoqd' flag ; do | |
case "${flag}" in | |
c) CLR=1 ;; # remove ucrt folder | |
s) DSRC=1 ;; # download source-code | |
a) BAVIF=1 ;; # build libavif | |
j) BJXL=1 ;; # build libjxl | |
p) BPLGS=1 ;; # build plugins | |
e) BEXIV=1 ;; # build exiv2 | |
o) BOPCV=1 ;; # build opencv |
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
#!/bin/bash | |
while getopts 'csajpyd' flag ; do | |
case "${flag}" in | |
c) CLR=1 ;; # remove clang folder | |
s) DSRC=1 ;; # download source-code | |
a) BAVIF=1 ;; # build libavif | |
j) BJXL=1 ;; # build libjxl | |
p) BPLGS=1 ;; # build plugins | |
y) BYACR=1 ;; # build yacreader | |
d) DYACR=1 ;; # deploy yacreader |
OlderNewer