Skip to content

Instantly share code, notes, and snippets.

View guest271314's full-sized avatar
💭
Fix WontFix

guest271314

💭
Fix WontFix
View GitHub Profile
@guest271314
guest271314 / web-socket-server.js
Created April 25, 2024 13:55 — forked from robertrypula/web-socket-server.js
WebSocket - binary broadcast example (pure NodeJs implementation without any dependency)
// Copyright (c) 2019-2021 Robert Rypuła - https://github.com/robertrypula
/*
+--------------------------------------------------+
| Binary broadcast WebSocket server in pure NodeJs |
+--------------------------------------------------+
Based on great article created by Srushtika Neelakantam:
https://medium.com/hackernoon/implementing-a-websocket-server-with-node-js-d9b78ec5ffa8
@guest271314
guest271314 / upFetch.js
Created April 21, 2024 18:11
L-Blondy up-fetch bundled with bun buil
// response-error.ts
class ResponseError extends Error {
name;
response;
options;
data;
constructor(res, data, options) {
super(`Request failed with status ${res.status}`);
this.data = data;
this.name = "ResponseError";
@guest271314
guest271314 / javascript_engines_and_runtimes.md
Last active April 21, 2024 06:12
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@guest271314
guest271314 / harmony.md
Last active April 20, 2024 09:01
Why I use node, deno, bun, qjs, tjs at the same time

Why I use node, deno, bun, qjs, tjs at the same time.

Winds up being a (not the) rather comprehensive JavaScript toolbox. The idea being for the modern JavaScript programmer can use all of the tools available for a given requirement, task or job, without preference for any. No external bundlers or compilers are needed. No frameworks are needed. I can use qjs or tjs for systems with minimal RAM and disk space; and when I want to use Web API's deno makes an effort to provide those interfaces. In some cases I can run the exact same code in bun, deno, and node, which provides a means to perform 1:1 testing as to performance.

There's probably a few things I am unintentionally omitting below. These are just a brief synposis. I'll update accordingly.

@guest271314
guest271314 / http_over_tcp_browser_server.md
Last active April 20, 2024 04:45
How to use the browser as an HTTP over TCP socket server

Today we will be using the Web browser (Google Chrome for Testing 125) as a local HTTP over TCP socket server.

WICG Direct Sockets specifies an API that provides TCPSocket, UDPSocket, and TCPServerSocket.

In Chromium based browsers, for example Chrome, this capability is exposed in an Isolated Web Apps (IWA).

Previously we have created an IWA that we launch from arbitrary Web sites with open(),

@guest271314
guest271314 / reddit_no_markdown.md
Created April 14, 2024 18:24
How is it that Reddit Web site maintainers can't figure out how to honor Markdown as default setting for comments and posts?

Screenshot_2024-04-14_11-12-28

@guest271314
guest271314 / compiling_standalone.md
Last active April 9, 2024 08:48
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.

E.g.,

bun run index.js
@guest271314
guest271314 / signals-proposal-bun-bundle.js
Created April 8, 2024 03:20
Signals proposal polyfill bundled with Deno
// vendor/esm.sh/v135/signal-polyfill@0.1.0/denonext/signal-polyfill.mjs
var $ = function(e, o) {
return Object.is(e, o);
};
var N = function(e) {
let o = i;
return i = e, o;
};
var ce = function() {
return i;
@guest271314
guest271314 / UseItBreakItFileBugsRequestFeaturesTestTestTestTestToThePointItBreaks.txt
Last active April 8, 2024 00:35
Use it. Break it. File Bugs. Request features. Test, test, test. Test to the point it breaks.
So we need people to have weird new
ideas ... we need more ideas to break it
and make it better ...
Use it. Break it. File bugs. Request features.
- Soledad Penadés, Real time front-end alchemy, or: capturing, playing,
altering and encoding video and audio streams, without
servers or plugins!
@guest271314
guest271314 / arbitrary_import_specifiers.md
Last active April 7, 2024 22:26
Intercepting and handling arbitrary static and dynamic Ecmascript import specifiers, protocols and file extensions