Write-LogMessage Verbose -Message 'stuff' -Json @{ 'user' = 'bob'; id = 100 }function New-SafeFileTimeNowString {
<#
.SYNOPSIS
timenow for safe filepaths: "2022-08-17_12-46-47Z"
.notes| import subprocess | |
| import re | |
| import requests | |
| import os | |
| from tqdm import tqdm # For progress bar | |
| def extract_media_id(url): | |
| """Extract media ID from TikTok video URL.""" | |
| match = re.search(r'/video/(\d+)', url) | |
| return match.group(1) if match else None |
| local mp = require 'mp' | |
| local autovsr_enabled = false | |
| local function autovsr() | |
| local display_width = mp.get_property_native("display-width") | |
| local video_width = mp.get_property_native("width") | |
| local display_height = mp.get_property_native("display-height") | |
| local video_height = mp.get_property_native("height") | |
| if video_width and display_width and video_height and display_height then |
| # Prerequisites | |
| - a machine with installed Windows, including the following tools: | |
| I recommend to use chocolatey as a package manager: | |
| ```choco install -y cpu-z hwinfo furmark gpu-z prime95``` | |
| - CPU-Z | |
| - HWInfo | |
| - Furmark | |
| - GPU-Z | |
| - Prime95 |
Write-LogMessage Verbose -Message 'stuff' -Json @{ 'user' = 'bob'; id = 100 }function New-SafeFileTimeNowString {
<#
.SYNOPSIS
timenow for safe filepaths: "2022-08-17_12-46-47Z"
.notes| using System; | |
| using System.Collections.Concurrent; | |
| using System.Management.Automation; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| public abstract class AsyncPSCmdlet : PSCmdlet, IDisposable | |
| { | |
| private enum PipelineType | |
| { |
| $framework = 'netstandard2.0' | |
| $folder = 'EventHubs' | |
| $packages = 'Azure.Messaging.EventHubs', 'Azure.Messaging.EventHubs.Processor' | |
| dotnet new classlib -f $framework -o "$folder.package" && | |
| Push-Location "$folder.package" && | |
| $packages | ForEach-Object { dotnet add package $_ } && | |
| dotnet publish --configuration Release -o lib && | |
| Add-Type -Path .\lib\*.dll && | |
| Pop-Location |
| using namespace System.Collections | |
| class PSCustomObjectEquatable : IEquatable[object] { | |
| hidden [object[]] $Properties | |
| hidden [object[]] $Values | |
| [object] $Instance | |
| PSCustomObjectEquatable([object] $Instance) { | |
| $psProperties = $Instance.PSObject.Properties | |
| $this.Instance = $Instance |
| $destination = 'path\to\destination' | |
| $inFS = [System.IO.File]::OpenWrite($destination) | |
| Get-ChildItem -Filter temp* | ForEach-Object { | |
| $stream = $_.OpenRead() | |
| $zip = [System.IO.Compression.ZipArchive]::new($stream, [System.IO.Compression.ZipArchiveMode]::Read) | |
| $entry = $zip.GetEntry($_.Name) | |
| $zipFS = $entry.Open() | |
| $zipFS.CopyTo($inFS) | |
| $zipFS, $zip, $stream | ForEach-Object Dispose |
| using namespace System.Drawing | |
| Add-Type -AssemblyName System.Drawing | |
| function Resize-Picture { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory)] | |
| [string] $SourcePath, |
| <?xml version="1.0" encoding="UTF-16"?> | |
| <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
| <RegistrationInfo> | |
| <Date>2022-10-23T19:30:00.0000000</Date> | |
| <Author>SCI\SpiralChaotic</Author> | |
| <URI>\SCI\LightModeEnable</URI> | |
| </RegistrationInfo> | |
| <Triggers> | |
| <CalendarTrigger> | |
| <StartBoundary>2022-10-23T06:30:00</StartBoundary> |