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
[System.Reflection.Assembly]::LoadWithPartialName('System.Drawing') | Out-Null; | |
$Icon = [System.Drawing.Icon]::ExtractAssociatedIcon( | |
[System.Environment]::ExpandEnvironmentVariables('%SystemRoot%\System32\newdev.exe') | |
); | |
$Stream = [System.IO.File]::Open( | |
'newdev.ico', | |
[System.IO.FileMode]::CreateNew | |
); | |
$Icon.Save($Stream); |
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
const originalAttachShadow = Element.prototype.attachShadow; | |
Element.prototype.attachShadow = function attachShadow(...args) { | |
const detail = originalAttachShadow.apply(this, args); | |
this.dispatchEvent(new CustomEvent("shadowRootAttached", { detail })); | |
return detail; | |
}; |
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
CLASS main DEFINITION | |
PUBLIC | |
FINAL | |
CREATE PUBLIC. | |
PUBLIC SECTION. | |
METHODS say_hello | |
IMPORTING | |
name TYPE string | |
RETURNING |
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 DataAppender(array = new Uint8Array(8)) { | |
let length = array.length; | |
let offset = 0; | |
let view = new DataView(array.buffer); | |
const textEncoder = new TextEncoder(); | |
const grow = () => { | |
length = array.length * 2; |
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
private fun convertToJson(v: Any?): String { | |
return when (v) { | |
is String -> v.toJson() | |
is Boolean -> v.toJson() | |
is Number -> v.toJson() | |
is Array<*> -> v.toJson() | |
is Collection<*> -> v.toJson() | |
is Map<*, *> -> v.toJson() | |
else -> v?.toJson() ?: "null" | |
} |
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
// Ported from https://github.com/deoxxa/proquint | |
const encodeConsonants = "bdfghjklmnprstvz".split(""); | |
const encodeVowels = "aiou".split(""); | |
const decodeConsonants = Object.fromEntries(encodeConsonants.map((x, i) => [x, i])); | |
const decodeVowels = Object.fromEntries(encodeVowels.map((x, i) => [x, i])); | |
export function encode(array: Uint16Array) { | |
const view = new DataView(array.buffer); | |
const bits = []; |
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> | |
<script> | |
customElements.define("x-input", class extends HTMLElement { | |
static formAssociated = true; | |
#input; | |
#internals; | |
constructor() { | |
super(); | |
this.#input = document.createElement("input"); |
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
@echo off | |
setlocal enabledelayedexpansion | |
if not exist %~dp0timeit.exe ( | |
curl -Lo %~dp0timeit.exe https://github.com/MarkTiedemann/rktools2k3/raw/master/timeit.exe | |
) | |
if not exist %~dp0jq.exe ( | |
curl -Lo %~dp0jq.exe https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe | |
) |
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
@echo off | |
setlocal | |
:: Example for using the JGit CLI on Windows | |
:: Downloaded from https://gist.github.com/MarkTiedemann/4a91db19983867fa1cd0c72f496ead2e | |
:: d(irectory) p(ath) of argument 0 (the current batch file) | |
set "basedir=%~dp0" | |
:: Remove trailing slash | |
set "basedir=%basedir:~0,-1%" |
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
const rawString = Symbol(); | |
export interface RawString { | |
[rawString]: string; | |
}; | |
export function raw(str: string): Readonly<RawString> { | |
const obj: RawString = Object.create(null); | |
obj[rawString] = str; | |
return Object.freeze(obj); |
NewerOlder