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
/** | |
* @file Pure Typed EventTarget | |
* @license Unlicense | |
*/ | |
export declare class TypedEventTarget<EventMap extends Record<string, Event>> | |
extends EventTarget { | |
addEventListener<Type extends keyof EventMap>( | |
type: Type, | |
listener: (this: this, evt: EventMap[Type]) => void, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Build-free Angular 17 app with @babel/standalone</title> | |
<script type="importmap"> | |
{ | |
"imports": { | |
"@angular/common": "https://esm.sh/v135/@angular/common@17.0.3?dev", |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Build-free Angular 17 app</title> | |
<script type="importmap"> | |
{ | |
"imports": { | |
"@angular/common": "https://esm.sh/v135/@angular/common@17.0.3?dev", |
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
// @ts-check | |
/** | |
* @file esbuild plugin for transforming TypeScript code using Typia | |
* | |
* CAUTION: this plugin will break the output source map. | |
* | |
* @example | |
* ```js:build.mjs | |
* import { build } from "esbuild"; |
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
#!/usr/bin/env node | |
// @ts-check | |
/** | |
* @file Decrypts data from stdin using a private key. | |
* | |
* @example | |
* node decrypt-forge.mjs [private-key-path] < encrypted-data.txt | |
* | |
* The default private key path is "private-key.pem". |
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
/** | |
* combine promises into an async generator in order of fast resolved | |
* @param promises promises to output | |
*/ | |
export async function* toAsyncGenerator<T>(promises: Iterable<Promise<T>>) { | |
const unresolvedPromises = new Set(promises); | |
const fulfilledValues: T[] = []; | |
for (const promise of promises) { | |
promise.then( | |
(value) => { |
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
@powershell/c '#'+(gc \"%~f0\"-ra)^|iex&exit/b | |
$ErrorActionPreference = 'Stop' | |
try { | |
$FeatureName = 'VirtualMachinePlatform' | |
$Feature = Get-WindowsOptionalFeature -Online -FeatureName $FeatureName | |
$Enabled = $Feature.State -eq 'Enabled' | |
$Feature |
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
export default a=>[...atob(a)].reduceRight((n,b)=>(n<<8n)+BigInt(b.charCodeAt(0)),0n) |
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
param($Port = 8081) | |
$ErrorActionPreference = 'Stop' | |
# $InformationPreference = 'Continue' | |
Write-Information "initiated" | |
$Listener = New-Object System.Net.HttpListener | |
$Listener.Prefixes.Add("http://localhost:$Port/") | |
$Listener.Start() |
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
#!/usr/bin/env pwsh.exe | |
<# | |
.PARAMETER Text | |
text to show | |
.PARAMETER Duration | |
duration of showing, value is millisecond | |
if set to -1, the bubble will not disappear automatically | |
.PARAMETER Id | |
indices of model (0 - 7) |
NewerOlder