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
#Requires -Version 6.0 | |
<# | |
.SYNOPSIS | |
Retrieves recent winget logs and searches them for a pattern, if specified. | |
.DESCRIPTION | |
This script parses the Windows Package Manager winget command-line tool log files and allows searching by specifying a pattern or date boundaries. | |
.PARAMETER Search | |
The pattern to search for in the log files. If not specified, all log entries are returned. | |
.PARAMETER AfterDate | |
The date after which to search for log entries. If not specified, all log entries are returned. |
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
#Requires -Modules PSParseHTML | |
function Install-XmlLint { | |
[CmdletBinding(SupportsShouldProcess)] | |
param ( | |
[Parameter(ValueFromPipelineByPropertyName)] | |
[string] | |
$InstallPath = (Join-Path -Path "$env:LOCALAPPDATA\Programs" -ChildPath xmllint), | |
[switch] | |
$Force | |
) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Get-Content -Path "$env:APPDATA\Code - Insiders\User\settings.json" | ConvertFrom-Json -AsHashtable | ForEach-Object { $sortedSettings = [System.Collections.Generic.SortedDictionary[string,pscustomobject]]::new(); ($vsCodeSettings = $_) | Write-Output } | Select-Object -ExpandProperty Keys | ForEach-Object { $sortedSettings.Add($_,$vsCodeSettings[$_] )} |
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
Get-Content -Path "$env:APPDATA\Code*\User\settings.json" | ForEach-Object -Begin { $pattern = '\$\{env:([^\}]+)\}'; } { $match = $_ | Select-String -Pattern $pattern; if ($null -ne $match) { $match = $match.Matches.Groups[1]; $match = (Get-Item -Path Env:\$match).Value -replace '\\', '\\'; $_ -replace $pattern, $match } else { $_ } } | Set-Content -Path ($temp = New-TemporaryFile) && Get-Content $temp | Set-Content -Path "$env:APPDATA\Code*\User\settings.json" |
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
"use strict"; | |
function stringSimilarity(str1, str2, gramSize = 2) { | |
function getNGrams(s, len) { | |
s = ' '.repeat(len - 1) + s.toLowerCase() + ' '.repeat(len - 1); | |
let v = new Array(s.length - len + 1); | |
for (let i = 0; i < v.length; i++) { | |
v[i] = s.slice(i, i + len); | |
} | |
return v; | |
} |
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
[System.Windows.Forms.Clipboard]::GetData("HTML Format") | ForEach-Object { $_ -replace '(?:<!--[^>]*-->|</?(html|body)>)' -split "`n"} | Select-Object -Skip 8 -First 1 | ForEach-Object { $_ -replace '<(\S+)[^>]*>','<$1>'} | Set-Clipboard |
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 | |
url=http://www.ghaemmagham.net/ | |
webarchive=https://web.archive.org | |
wget="wget -e robots=off -nv" | |
tab="$(printf '\t')" | |
additional_url=url.list | |
# Construct listing.txt from url.list | |
# The list of archived pages, including some wildcard url |
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
// To disable gold memberships for all students on the current page, use the following two lines. | |
let disableGold = document.querySelectorAll("#app > div > main > section > div.body.empty > div.my-kids-list > div > div.list-item-info > div.user-info > div.user-tagline-info > a.membership-icon.icons-gold.remove-gold-membership-small.i-block.mright5") | |
disableGold.forEach(e=>{ setTimeout(e.click(),500) }) | |
// To enable gold memberships for all students on the current page, use the following two lines. | |
let enableGold = document.querySelectorAll("#app > div > main > section > div.body.empty > div.my-kids-list > div > div.list-item-info > div.user-info > div.user-tagline-info > a.membership-icon.icons-gold.add-gold-membership-small.i-block.mright5") | |
enableGold.forEach(e=>{ setTimeout(e.click(),500) }) |
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
$TakeoutExtractedPath = "C:\Users\mavad\AppData\Local\Temp\MicrosoftEdgeDownloads\6acfbb86-1c53-4929-9741-118ff28d0db0\Takeout\Fit\All Data" | |
$UtcOffset = [System.TimeZone]::CurrentTimeZone.GetUtcOffset(0).Hours | |
(Get-ChildItem -Path $TakeoutExtractedPath -Filter *blood* -Recurse | ForEach-Object { | |
Get-Content -Path $_ | ConvertFrom-Json | Select-Object -ExpandProperty 'Data Points' | |
} | ForEach-Object { | |
[pscustomobject]@{ | |
Date = [datetime]::UnixEpoch.AddMicroseconds(($_.endTimeNanos * 1E-3)).AddHours($UtcOffset) | |
Systolic = $_.fitValue.value.fpVal[0]; | |
Diastolic = $_.fitValue.value.fpVal[1] | |
} | Write-Output |