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
| import LZString from "lz-string"; | |
| class ByteBuffer { | |
| off: number = 0; | |
| constructor(public buf: Buffer, public littleEndian: boolean) {} | |
| readShort() { | |
| const v = this.buf[this.littleEndian ? "readInt16LE" : "readInt16BE"]( | |
| this.off, |
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
| Element.prototype.addEventListener = new Proxy( | |
| Element.prototype.addEventListener, | |
| { | |
| apply(target, props, args) { | |
| const h = args[1]; | |
| args[1] = (ev) => | |
| h( | |
| new Proxy(ev, { | |
| get: (target, p) => p === "isTrusted" || target[p], | |
| }), |
This script works for patching any Microsoft VSCode extension so it will work on it's forks including:
- VSCodium
- Cursor
- Windsurf
This discussion motivated me to make this simple script: VSCodium#1641
Currently tested only on Pylance/VSCodium but as long as it's Microsoft's extension that blocks VSCode forks, it should be fine.
The code uses fairly generic patterns to ensure it's cross-compatible with other extensions than the one I tested!
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
| import { readdirSync, readFileSync, writeFileSync } from "fs" | |
| const channelIds = (() => { | |
| const files = readdirSync("Messages", { withFileTypes: true }) | |
| .filter(x => x.isDirectory() && x.name.startsWith("c")) | |
| return files.map(x => x.name.slice(1)) | |
| })() | |
| const messages = channelIds.reduce((acc, id) => { |
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
| const hexToCol = (hex) => { | |
| hex = hex.replace(/^#/, "") | |
| if (hex.length === 3) hex = hex.split("").map(c => c.repeat(2)).join("") | |
| return Array.from(hex.matchAll(/[0-9a-fA-F]{2}/g)).map(m => parseInt(m[0], 16)) | |
| } | |
| const hexToTmColor = (hex) => hexToCol(hex).map(n => Math.floor(n / 17)) | |
| const hexToTmcolorHex = (hex) => hexToTmColor(hex).map(n => n.toString(16).toUpperCase()).join("") | |
| const hex = "#FD66CC" | |
| const tmColor = hexToTmcolor(hex) |
NewerOlder