This file contains 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
gh -R aria2/aria2 release download -p '*win-64*' |
This file contains 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 prompt { | |
$private:Token = "→" | |
Write-Host -NoNewline $Token | |
" " | |
} |
This file contains 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
Import-Module PSReadLine | |
Import-Module PSFzf | |
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r' | |
$commandOverride = [ScriptBlock]{ param($Location) Write-Host $Location } | |
Set-PsFzfOption -AltCCommand $commandOverride | |
Set-PSReadLineKeyHandler -Key Tab -ScriptBlock { Invoke-FzfTabCompletion } | |
$host.ui.RawUI.WindowTitle = "PowerShell $($PSVersionTable.PSVersion)" | |
# deno completions powershell | Out-String | Invoke-Expression | |
# caddy completion powershell | Out-String | Invoke-Expression |
This file contains 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-ChildItem -Recurse -Depth 2 | Where-Object -Property Length -GT 1MB | % { [pscustomobject]@{Length=$_.Length;Folder=$(Resolve-Path -Path $_.Directory -Relative).Replace('.\','');Name=$_.Name} } | Group-Object Folder | % {[pscustomobject]@{Name=$_.Name;Size=$_.Group | Measure-Object -Property Length -Sum | Select-Object -ExpandProperty Sum;Files=$_.Group|Sort-Object -Property Length}} | Sort-Object Size | % { $Folder=$_;$_.Files | % { [pscustomobject]@{Length=$_.Length;Folder=$Folder.Name;Name=$_.Name} } } | Format-Table @{n='Length';e={Format-FileSize $_.Length};align='right'},Name -GroupBy Folder |
This file contains 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
/** | |
* Generate integers ranging from the lower limit to the upper limit as an iterator. | |
* | |
* @param m? - Optional, Integer lower limit of generator. Defaults to 0. | |
* @param M - Required, Integer upper limit of generator. | |
*/ | |
function δ (minimum: number, maximum: number): IterableIterator<number>; | |
function δ (Δ: number): IterableIterator<number>; | |
function * δ (h: number, k?: number?): IterableIterator<number> | |
{ |
This file contains 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
// run this in the 'browser' | |
function * getPersonsResults () { | |
for (const result of document.querySelector('#results-list').querySelectorAll('.result')) { | |
const nameContainer = result.querySelector('.name-container'); | |
const primaryName = nameContainer.querySelector('h3').textContent.trim(); | |
const aliases = [...nameContainer.querySelectorAll('.aliases .alias')].map(it => it.textContent.trim()) | |
const locations = [...result.querySelectorAll('.locations-container .person-location')].map(location => location.textContent.trim()); | |
const relatives = [...result.querySelectorAll('.relatives-container .person-relative')].map(location => location.textContent.trim()); | |
const age = result.querySelector('.age-container h2').textContent.trim(); |
This file contains 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* createObjectThrough0 (object) { | |
const entries = Object.entries(object); | |
const objects0 = []; | |
const objects1 = []; | |
for (let currentEntryIndex = 0, | |
maximumEntryIndex = entries.length; | |
currentEntryIndex < maximumEntryIndex; | |
currentEntryIndex++) |
This file contains 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 * count() { | |
const maximum = | |
(arguments.length === 1 && typeof arguments[0] === "number") ? arguments[0] : | |
(arguments.length === 1 && typeof arguments[0] === "object" && arguments[0].hasOwnProperty("maximum")) ? arguments[0].maximum : | |
(arguments.length === 1 && typeof arguments[0] === "object" && arguments[0].hasOwnProperty("max")) ? arguments[0].max : | |
(arguments.length === 2 || arguments.length === 3) ? arguments[1] : 0; | |
const minimum = | |
(arguments.length === 1 && typeof arguments[0] === "number") ? 0 : | |
(arguments.length === 1 && typeof arguments[0] === "object" && arguments[0].hasOwnProperty("minimum")) ? arguments[0].minimum : |
This file contains 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 * count() { | |
const maximum = | |
(arguments.length === 1 && typeof arguments[0] === "number") ? arguments[0] : | |
(arguments.length === 1 && typeof arguments[0] === "object" && arguments[0].hasOwnProperty("maximum")) ? arguments[0].maximum : | |
(arguments.length === 1 && typeof arguments[0] === "object" && arguments[0].hasOwnProperty("max")) ? arguments[0].max : | |
(arguments.length === 2 || arguments.length === 3) ? arguments[1] : 0; | |
const minimum = | |
(arguments.length === 1 && typeof arguments[0] === "number") ? 0 : | |
(arguments.length === 1 && typeof arguments[0] === "object" && arguments[0].hasOwnProperty("minimum")) ? arguments[0].minimum : |
This file contains 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 * count() { | |
const maximum = | |
(arguments.length === 1 && typeof arguments[0] === "number") ? arguments[0] : | |
(arguments.length === 1 && typeof arguments[0] === "object" && arguments[0].hasOwnProperty("maximum")) ? arguments[0].maximum : | |
(arguments.length === 1 && typeof arguments[0] === "object" && arguments[0].hasOwnProperty("max")) ? arguments[0].max : | |
(arguments.length === 2 || arguments.length === 3) ? arguments[1] : 0; | |
const minimum = | |
(arguments.length === 1 && typeof arguments[0] === "number") ? 0 : | |
(arguments.length === 1 && typeof arguments[0] === "object" && arguments[0].hasOwnProperty("minimum")) ? arguments[0].minimum : |
NewerOlder