Skip to content

Instantly share code, notes, and snippets.

View TheJoeFin's full-sized avatar

Joe Finney TheJoeFin

View GitHub Profile
function wup {
$desktop = [Environment]::GetFolderPath('Desktop')
$initial = Get-ChildItem $desktop -Name
Write-Host "Starting winget upgrade..." -ForegroundColor Yellow
Start-Process winget -ArgumentList "upgrade --all --silent" -Verb RunAs -Wait
Start-Sleep 5
Write-Host "Checking for new icons..." -ForegroundColor Cyan
@TheJoeFin
TheJoeFin / gist:98ca55fe8a968752eec2802666ff45da
Created December 25, 2024 19:24
Powershell Power Report with Date Time one liner
$filePath = "$([Environment]::GetFolderPath('MyDocuments'))\PowerReport-$(Get-Date -Format 'yyyy-MM-dd_HH-mm-ss').html"; sudo powercfg /systempowerreport /output $filePath; Invoke-Item $filePath
@TheJoeFin
TheJoeFin / OpenWeatherOneCall.ts
Last active June 21, 2024 16:18
Typescript Types for OpenWeatherAPI One Call API 3.0
export type OneCallResponse = {
lat: number
lon: number
timezone: string
timezone_offset: number
current: CurrentWeather
minutely: Minutely[]
hourly: Hourly[]
daily: Daily[]
alerts: Alert[]
@TheJoeFin
TheJoeFin / CustomPen.cs
Created September 11, 2018 01:41
A sample custom pen
protected override InkDrawingAttributes CreateInkDrawingAttributesCore(Brush brush, double strokeWidth)
{
InkDrawingAttributes inkDrawingAttributes = new InkDrawingAttributes
{
PenTip = PenTipShape.Circle
};
SolidColorBrush solidColorBrush = brush as SolidColorBrush;
inkDrawingAttributes.Color = solidColorBrush?.Color ?? Colors.Red;
inkDrawingAttributes.DrawAsHighlighter = false;
inkDrawingAttributes.Size = new Windows.Foundation.Size(strokeWidth * 0.5, strokeWidth * 0.5);