Skip to content

Instantly share code, notes, and snippets.

View dumbmoron's full-sized avatar
😹
meow

jj dumbmoron

😹
meow
View GitHub Profile
function is_extension_of(extension, original) {
if (original.length > extension.length) {
return false;
}
let j = 0;
for (let i = 0; i < extension.length; i++) {
if (extension[i] === original[j]) {
j++;
}
type Address = {
type: 4 | 6,
value: bigint
};
type Prefix = {
prefix: Address,
length: number
};
const sub = net => 2 ** (32 - net),
fits = (net, num) => num - sub(net) >= 0;
const nets = num => {
const cidr = [];
while (num) {
let net = 32;
while (fits(num, net - 1))
net--;
0.13272428659412816 Apple Inc.,Apple GPU
0.05886881543830835 Google Inc. (Apple),ANGLE (Apple, ANGLE Metal Renderer: Apple M1, Unspecified Version)
0.038595770888934504 Google Inc. (Intel),ANGLE (Intel, Intel(R) Iris(R) Xe Graphics (0x00009A49) Direct3D11 vs_5_0 ps_5_0, D3D11)
0.03721001847669882 Google Inc. (Apple),ANGLE (Apple, ANGLE Metal Renderer: Apple M2, Unspecified Version)
0.036132211044959964 Google Inc. (Apple),ANGLE (Apple, ANGLE Metal Renderer: Apple M1 Pro, Unspecified Version)
0.02504619174707453 Google Inc. (Apple),ANGLE (Apple, ANGLE Metal Renderer: Apple M3, Unspecified Version)
0.02386573598850341 Google Inc. (Google),ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver)
0.021350851981112712 Google Inc. (Apple),ANGLE (Apple, ANGLE Metal Renderer: Apple M3 Pro, Unspecified Version)
0.015551221515089307 Google Inc. (Apple),ANGLE (Apple, ANGLE Metal Renderer: Apple M2 Pro, Unspecified Version)
0.015191952371176352 Google Inc. (Apple),ANGLE (Apple, ANGLE M
// ==UserScript==
// @name bypass tiktok block
// @namespace http://tampermonkey.net/
// @version 2025-01-19
// @description replaces the `store-country-code` cookie with a non-US one
// @author jj
// @match https://www.tiktok.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tiktok.com
// @grant GM_cookie
// ==/UserScript==
// ==UserScript==
// @name fix netdata cloud
// @version 2025-01-17
// @description disarms the "local dashboard does not allow more than 5 active nodes" warning on netdata cloud dashboard
// @author jj <[email protected]>
// @match https://<your_netdata_hostname_goes_here>/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=netdata.cloud
// @grant none
// ==/UserScript==
@dumbmoron
dumbmoron / rpgrep
Last active February 12, 2024 19:19
#!/bin/sh
# rpgrep - recursive pgrep(1)
[ $# = 0 ] \
&& echo "usage: $0 <pid>" \
&& exit 1
get_children() {
pgrep -P "$1" | \
while read pid; do
#include <stdio.h>
#define dont int
#define care main(
#define CURSE void
#define OF ) {
#define RA 0;
#define 𓀷 int
#define 𓃰 if
#define 𓂔 {
#define 𓂕 }
#!/usr/bin/env bash
# utility for syncing docker images across repos, or even registries
# depends on regclient. installation guide: https://github.com/regclient/regclient/blob/main/docs/install.md
# edit IMAGE_A and IMAGE_B below to whatever you want
# if the tags exist on both sides, but differ, A is the authoritative source (B will be overwritten)
IMAGE_A="ghcr.io/wukko/cobalt"
IMAGE_B="ghcr.io/justusecobalt/cobalt"
set -eu -o pipefail