Skip to content

Instantly share code, notes, and snippets.

View guest271314's full-sized avatar
Fix WontFix


Fix WontFix
View GitHub Profile
guest271314 / MP3Stream.js
Created February 18, 2024 16:32
MP3 encoder
View MP3Stream.js
var url = URL.createObjectURL(new Blob([await (await fetch('')).text()],{
type: "text/javascript"
var dir = await;
var handle;
try {
handle = await dir.getFileHandle("lame.js", {
create: false,
guest271314 /
Created February 14, 2024 04:55
Google advertising "A.I.". Where's TTS/STT shipped in Chromium and Chrome?
guest271314 / delete_deno_global_cache.js
Last active February 12, 2024 07:53
Delete Deno global cache directories
View delete_deno_global_cache.js
const decoder = new TextDecoder();
const command = new Deno.Command(Deno.execPath(), {
args: [
const { code, stdout, stderr } = await command.output();
// 11.b. Let rootName be the empty String.
guest271314 / gdm_capture_monitor_device_on_chromium.js
Created February 8, 2024 05:32
Finally possible to capture monitor devices in Chromium and Chrome on Linux
View gdm_capture_monitor_device_on_chromium.js
// Finally possible to capture speechSynthesis.speak() on Chromium and Chrome
// Enable Speech Dispatcher, PulseAudio loopback for screen capture, disable default WebRTC input volume adjustment from 100% to 8%
// chrome --enable-speech-dispatcher --enable-features=PulseaudioLoopbackForScreenShare --disable-features=WebRtcAllowInputVolumeAdjustment
// Still have to manually select share system audio in picker with systemAudio set to "include"
let stream = await navigator.mediaDevices.getDisplayMedia({
// We're not going to be using the video track
video: {
width: 0,
height: 0,
guest271314 / buffer-bun-bundle.js
Last active January 20, 2024 04:00
feross/buffer bundled to Ecmascript Module
View buffer-bun-bundle.js
// git clone
// cd buffer
// bun install base64-js ieee754
// bun build ./index.js --target=browser --outfile=buffer.js
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
// node_modules/base64-js/index.js
var require_base64_js = __commonJS((exports) => {
var getLens = function(b64) {
guest271314 /
Last active February 22, 2024 05:42
Compiling a standalone executable using modern JavaScript/TypeScript runtimes

Compiling a standalone executable using modern JavaScript/TypeScript runtimes

We have the same code working using node, deno, and bun.


bun run index.js
guest271314 /
Created January 7, 2024 04:02
Hopping over and tunneling under gates to get keys

Hopping over and tunneling under gates to get keys

Chrome Apps used to have chrome.sockets. Then Chrome Apps were deprecated, along with chrome.sockets.

Along comes Direct Sockets. Revival of TCP sockets, UDP sockets, TCP socket server implementation that can be used in the browser.

Direct Sockets was initially gated behind a Progressive Web App on Chrome, then gated behind a different API, Isolated Web Apps (IWA) using Signed Web

guest271314 / dynamic_import_always_throws.js
Created January 3, 2024 05:26
Deno dynamic import("./exports") throws module not found for "exports.js" dynamically created in the script
View dynamic_import_always_throws.js
// Deno dynamic import("./exports") throws module not found for "exports.js" dynamically created in the script
// dynamic_import_always_throws.js
// References:
// Usage:
// deno run -A dynamic_import_always_throws.js
// bun run dynamic_import_always_throws.js
// node --experimental-default-type=module dynamic_import_always_throws.js
import { open, unlink } from "node:fs/promises";
const runtime = navigator.userAgent;
const encoder = new TextEncoder();
guest271314 /
Created January 2, 2024 01:16
Reddit's site search is horrible. Some programmer kindly help them out...

So, somebody posted a question or r/javascript. In that question they used the term "Spread and Rest Operators". Now, ECMA-262 does not define spread syntax or rest element as operators. Nonetheless people have repeated that term over and over again.

At one point I asked the question about who came up with the terms "spread operator" on r/javascript.

Should be easy enough to search for and get the results I'm looking for using Reddit's search implementation... It ain't though. I tried on r/javascript using "spread operator" and author:guest271314; I tried on the site search as a whole. I tried for 10 minutes to find that post, my post, using Reddit's search implementation.

I wound up going through the pseudo-infinite scroll of my posts to locate the question I asked to ultimately find the comment where I posted the earliest usage of the term "spread operator" I could find online

guest271314 /
Created December 31, 2023 13:18
Install repositories from GitHub to node_modules for Deno

Deno doesn't have a way to install repositories from GitHub to the local node_modules folder.