Skip to content

Instantly share code, notes, and snippets.

View direct-dom-diff.js
let curr_document = null;
let curr_parent = null;
let curr_node = null;
let curr_focus_path = null;
function assert (statement, message) {
if (!statement) throw new Error(message);
}
@intrnl
intrnl / react-asset-loader.js
Created Jun 9, 2021
React concurrent asset loader
View react-asset-loader.js
import { unstable_getCacheForType } from 'react';
import deepEqual from 'fast-deep-equal';
let hasArgs = (args) => (record) => deepEqual(args, record.args);
class Asset {
#loader;
#lifespan;
View patch_trace.js
// monkey patches all class methods for tracing calls
// not made for async methods
function patch_trace (cl, depth = Infinity) {
let proto = cl.prototype;
do {
if (!depth-- || proto === Object.prototype) break;
let name = proto.constructor.name;
View eventemitter.js
class EventEmitter {
#events = new EventTarget();
#map = new WeakMap();
on (type, listener, opts = {}) {
let { once = false } = opts;
let fn = this.#map.get(listener);
if (!fn) {
fn = (ev) => listener(...ev.detail);
View holder.md

i hold intrnl#7717 754023929848397824

prev .intrnl#6380 443765978132643850

are you happy now avi

@intrnl
intrnl / proton-compact-userchrome.css
Last active Jun 4, 2021
Revert Firefox Proton to Photon compact
View proton-compact-userchrome.css
/**
* Moved to a new repository.
* https://github.com/intrnl/firefox-revert-proton
*/
:root {
--tab-min-height: 28px !important;
--toolbarbutton-inner-padding: 6px !important;
--toolbarbutton-outer-padding: 1px !important;
--toolbar-start-end-padding: 1px !important;
View scraped_anilist_20210408.json
[
"https://twitter.com/heroaca_anime",
"https://twitter.com/DemonSlayerUSA",
"https://twitter.com/sao_anime",
"https://twitter.com/opm_anime",
"https://twitter.com/anime_shingeki",
"https://twitter.com/yakuneba_staff",
"https://twitter.com/koenokatachi_M",
"https://twitter.com/ansatsu_anime",
"https://twitter.com/SG_anime",
View DisableCutCopyPaste-killer.user.js
// ==UserScript==
// @name DisableCutCopyPaste-killer
// @match *://siska.smkteljkt.com/*
// @match *://mylms.telkomschools.sch.id/*
// @grant none
// @version 1.0
// @author intrnl
// ==/UserScript==
@intrnl
intrnl / clear_mal.js
Last active Feb 8, 2021
Clear MyAnimeList
View clear_mal.js
let sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
let random = (min, max) => ~~(Math.random() * (max - min) + min);
let form_data = new FormData();
form_data.append('csrf_token', document.querySelector('meta[name=csrf_token]').content);
let elements = Array.from(document.querySelectorAll('.animetitle'));
console.log(`${elements.length} to delete`);
View discord-ws.ts
import { getPlatformInfo } from '../utils/platform';
import { noop } from '../utils/util';
import * as http from '../lib/http';
import { GATEWAY_VERSION } from '../constants/endpoints';
import { GATEWAY } from '../constants/api';
import { GatewayOP, ConnectionStatus } from '../constants/gateway';
import { Inflate } from '@intrnl/pako-esm/inflate';
import { Z_SYNC_FLUSH } from '@intrnl/pako-esm/constants';