Skip to content

Instantly share code, notes, and snippets.

@fnky
fnky / ANSI.md
Last active July 27, 2024 22:42
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@Silvyre
Silvyre / ACCio.dat
Last active May 20, 2024 18:16
🧙🐑 AutoControl for Colonist.io (ACCio): play Colonist.io using your keyboard! Setup instructions in comments below.
{"customEntities":{"script":[["1",{"name":"wall.js","value":{"mdTime":1641400238352,"srcCode":"await ACCio(_ => {\n socketGameSend.buildCityWall();\n selectNextAfterDelay();\n});"}}],["2",{"name":"setup.js","value":{"mdTime":1656815986599,"srcCode":" try {\n return ACCio(_ => console.log(\"ACCio is already enabled! Try refreshing if you're having trouble.\"));\n }\n catch (e) { console.error(e) }\n\n try {\n await ACtl.runInPageCtx('https://cdn.jsdelivr.net/gh/CoeJoder/waitForKeyElements.js@v1.2/waitForKeyElements.js');\n }\n catch {\n return ACtl.runInPageCtx(_ => console.error('ACCio failed to load all required libraries.'));\n }\n\n ACCio = new Proxy(ACtl.runInPageCtx, {\n apply: (target, thisArg, argumentsList) => {\n if (['INPUT', 'TEXTAREA'].includes(document.activeElement.tagName)) {\n return;\n }\n\n try { return target(...argumentsList); }\n catch (e) { console.error(e) }\n }\n });\n\n await ACtl.runInPageCtx(_ => waitForKeyElements('canvas[style*
@trackd
trackd / protocolhandler-clipboard.ps1
Created December 28, 2023 01:50
prototype something something
function Add-ClipboardProtocolHandler {
# clipboard://
$custom = Get-Command "$env:temp\customclip.exe" -CommandType Application -ErrorAction 'Stop'
$uri = 'clipboard'
if (!(Test-Path "HKCU:\Software\Classes\$uri")) {
New-Item "HKCU:\Software\Classes\$uri"
}
Set-ItemProperty "HKCU:\Software\Classes\$uri" '(Default)' "URL:$uri Protocol"
Set-ItemProperty "HKCU:\Software\Classes\$uri" 'URL Protocol' ''
if (!(Test-Path "HKCU:\Software\Classes\$uri\shell")) {
function Get-MyDisk {
[CmdletBinding()]
param(
[Alias('DeviceId')]
[int] $Number,
[string] $FriendlyName
)
if (-Not ('Pinvoke.Win32Utils' -as [type])) {
Add-Type -TypeDefinition @'