Log Locations for several apps, in one place. Started: 2024-07
See LogPaths.yml
| function InvokeS3 { | |
| <# | |
| .SYNOPSIS | |
| wraps the aws s3 command with some validation | |
| .example | |
| InvokeS3 -WhatIf -Source /tmp/foo -Recursive | |
| # VERBOSE: s3 cp /tmp/foo s3://bucket/ | |
| InvokeS3 -WhatIf -Source '.' -Recursive -Includes '*.jpg', '*.png' -Excludes '*' |
| function Dotils.Gh.Gist.List.Export { | |
| <# | |
| .SYNOPSIS | |
| Quickly list your own gists and pipe | |
| #> | |
| param( | |
| [int] $Limit = 200, | |
| [string] $Pattern, | |
| [switch] $OutGridView | |
| ) |
| <# | |
| see also: | |
| Cli and bootstrap files in: https://github.com/microsoft/vscode/tree/main/src | |
| You could grep the tree for the Env vars it uses | |
| Using this syntax prevents accidentally launching code (the native command) with a broken filepath. Like if you missed quotes. | |
| otherwise it'll try to make it. | |
| code -g (gi -ea 'stop' $path) |
| using namespace System.Collections.Generic | |
| function GetLogs { | |
| # BinArgs is built conditionally based on what parameters are used | |
| param( | |
| [int] $Limit, | |
| [datetime] $Since, | |
| [switch] $OneLine, | |
| # preview the command line that's generated without running git |
| using namespace System.Collections.Generic | |
| # the final command will be | |
| # git clone --branch release/v7.4 --shallow-since=2024-07-07 https://github.com/PowerShell/PowerShell | |
| $cloneUrl = 'https://github.com/PowerShell/PowerShell' | |
| $Since = [datetime]::Now.AddDays(-30 ) | |
| $Branch = 'release/v7.4' | |
| $binGit = Get-Command -Name 'git' -CommandType Application -ea 'stop' | |
| # this bypasses most aliases or functions named 'git' |
| using namespace System.Collections.Generic | |
| $RoboAppConf ??= @{ | |
| Root = $PSScriptRoot | Get-Item | |
| Log = @{ | |
| Path = Join-Path (Get-item 'temp:') 'last-robocopy.log' | |
| } | |
| } | |
| function Invoke-Robocopy { |
| // you can run it in your browser's dev console | |
| clipboard = `Requested on,Dataflow name,Dataflow refresh status,Table name,Partition name,Refresh status,Start time,End time,Duration,Rows processed,Bytes processed (KB),Max commit (KB),Processor Time,Wait time,Compute engine,Error, | |
| 2024-07-23 11:07:21,MARIDateTable(PQuery),Failed,MariDateTable,NA,Failed,2024-07-23 11:07:21,2024-07-23 11:07:52,00:00:30.9630,NA,NA,NA,NA,NA,NA,Error: Request ID: 1d64d6e8-e9e4-c8e2-a34a-c8d1eddf9697 Activity ID: ed7e87a8-61c0-4dd4-94ab-feb90fa71269` | |
| function ErrorAsPairs ( text ) { | |
| let [ list1, list2 ] = clipboard.split('\n') | |
| zip = (a, b) => a | |
| .map( (k, i) => [ k, b[i] ] ) ; |
| Import-Module Rocker -ea 'stop' | |
| function Dock.Container.FirstId { | |
| return (docker container ls)[0].Id | |
| } | |
| Export-ModuleMember -function @('Dock.*') -alias @( 'Dock.*') |
Log Locations for several apps, in one place. Started: 2024-07
See LogPaths.yml
| function resolveAfterDelay(x, ms) { | |
| // async invoke after x milliseconds | |
| return new Promise((resolve) => { | |
| setTimeout(() => { | |
| resolve(x); | |
| }, ms ?? 200 ); | |
| }); | |
| } | |
| async function f1() { |