Skip to content

Instantly share code, notes, and snippets.

@o0101
o0101 / WORKS.md
Last active April 29, 2025 06:44
Look on my works ye mighty and despair

My Works - A collection of fun hacks, tools, products and experiments that are creative and inventive.

An incomplete list of all my creative output over the last 15 years. Selected based on how I feel about it right now.

  • Puppetromium - Hacking CSS @media queries to probe viewport size, MJPEG and 0% client-side JavaScript to make a remote browser. Sep 22, 2021.
  • Selector Generalization - Hacking a bioinformatics DNA sequence alignment algorithm to select all related elements on a page by clicking examples. Jan 1, 2013.
  • [Language Detection](no link available) - Using LZ factorization and letter bi- and trigrams to fingerprint human languages for detection from samples. February 1, 2013.
  • Janus - Overcoming the core challenge of WebRTC by hacking GitHub Actions to use Issues as a signalling channel to negotiate the connection. Nov 13, 2023.
  • [Fully Hosted](https://git
@o0101
o0101 / nosqlite.ts
Last active December 22, 2024 11:23 — forked from vedantroy/demo.ts
SQLite-backed key-value store with JS-like object manipulation and automatic JSON serialization.
import Database from 'better-sqlite3';
import { createDatabaseClient } from 'my-partial-db-lib';
// 1) Create an in-memory DB and your table(s).
const db = new Database(':memory:');
db.exec(`
CREATE TABLE users (
id TEXT PRIMARY KEY,
data JSON
);
@vedantroy
vedantroy / demo.ts
Last active December 31, 2024 09:15
SQLite-backed key-value store with JS-like object manipulation and automatic JSON serialization.
import Database from 'better-sqlite3';
import { createDatabaseClient } from './proxy.ts';
// 1) Create an in-memory DB and your table(s).
const db = new Database(':memory:');
db.exec(`
CREATE TABLE users (
id TEXT PRIMARY KEY,
data JSON
);
@o0101
o0101 / the roots of complacency.md
Created October 15, 2024 15:57
The Roots of Complacency by Dr. J. Allen Hynek

source: Dr. Willy Smith Unicat Project June 1999, https://rense.com/ufo5/hudsonv.htm

The Roots of Complacency by Dr. J. Allen Hynek

Something truly astonishing happened.... Not far from New York City, along the Hudson Valley, as hundreds of astonished people looked up, many driving along the Taconic Parkway, they saw something no one had ever seen before. Some called it a "Space-ship from outer space" (for want of anything better) but it was generally described by numbers of competent, professional persons as startlingly brilliant lights, in the form of a "V", or Boomerang, silent, slowly-moving, and very large close-by object. It has often popularly been called the "Westchester (County) Boomerang".

The world has never known about this, even though the event happened not once but several times, and over the course of several years. To all intents and purposes, this was a non-event. The media across the world has remained dumb. Local papers, radios and TV's, it is true, did momentarily carry spots along

@o0101
o0101 / README.md
Last active November 10, 2023 09:37
Implementing Protected Members in JavaScript by Hacking Symbols and Private Fields

Implementing Protected Members in JavaScript Classes

Introduction

In many object-oriented languages, the concept of protected members allows properties and methods to be accessible within the class they are defined, as well as by subclasses. JavaScript, however, does not natively support protected members. This article introduces a novel approach to simulate protected access in JavaScript classes using symbols and private fields.

The Challenge

JavaScript provides private fields, but they are not accessible to any derived classes. This limitation means that developers cannot use private fields to directly implement protected members, which are a staple in many other object-oriented languages.

One Solution

The solution involves using symbols as keys for protected properties and methods, ensuring that only the class and its subclasses have access to them. This is achieved by:

@o0101
o0101 / base.js
Last active November 10, 2023 09:37
Simple Custom Element Base Class With Neat Implicit Templating
{
const $ = Symbol(`[[state]]`);
class Base extends HTMLElement {
static get observedAttributes() {
return ['state'];
}
constructor(state) {
super(state);
@o0101
o0101 / !WITH_LOCK.md
Last active November 10, 2023 09:37
with_lock: A simple Bash decorator function for concurrency control

with_lock

Simplify Bash Locking: Your Decorator for Safe Scripting

Hey, scripter! Need to make your Bash functions play nice in the concurrency sandbox? You're in luck!

with_lock is your go-to decorator. It ensures specified functions run one at a time, even across multiple script instances. 🤖

Caveats

  • It's mostly FIFO (first in, first out), but occasionally things get a bit mixed. 🤷‍♀️
@camthesaxman
camthesaxman / win98.html
Last active June 16, 2023 15:45
Windows 98 Simulator
<html>
<head>
<title>Windows 98</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://unpkg.com/98.css">
<style>
/* Disable image filtering */
img {
image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */
@stefanocudini
stefanocudini / web_htop.sh
Last active January 3, 2023 04:23
web colored interface for htop
#!/bin/bash
# requirements: apt install nmap htop aha
# (aha is ANSI color to HTML converter)
ncat -k -l -p 9999 -c "echo 'HTTP/1.1 200 OK\nContent-type: text/html\nconnection: close\\n'; echo q | htop | aha --black --line-fix"
@ilokhov
ilokhov / export-sync-bookmarks.js
Last active September 30, 2024 11:44
Node.js script for exporting and synchronising bookmarks from Google Chrome
const fs = require("fs");
const path = require("path");
function newItem(name, url) {
return { name, url };
}
const bookmarkPath = path.join(
process.env.HOME,
"/Library/Application Support/Google/Chrome/Default/Bookmarks"