Skip to content

Instantly share code, notes, and snippets.

@CyanChanges
CyanChanges / build.boringssl.zig
Created March 27, 2026 13:19
Build boringssl in Zig Build System
const std = @import("std");
fn unpack_json_sources(arr: std.json.Value, alloc: std.mem.Allocator) std.ArrayList([]const u8) {
var result: std.ArrayList([]const u8) = .empty;
for (arr.array.items) |it| {
result.append(alloc, it.string) catch @panic("OOM");
}
return result;
}
@CyanChanges
CyanChanges / userscript.js
Created February 2, 2026 10:55
Microslop
// ==UserScript==
// @name Microslop
// @version 2026-01-22
// @description Fix Microslop
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
@CyanChanges
CyanChanges / magic.nu
Created October 5, 2025 07:49
Caddy serve config generator in Nushell
#!/usr/bin/env nu
# Copyright (c) 2025 Cyan Changes
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
@CyanChanges
CyanChanges / koishi.userscript.js
Created August 17, 2024 12:02
Wappalyzer but hacked (with everything Koishi.js)
// ==UserScript==
// @name It's Koishi
// @version 1.0
// @description try to take over the world via Koishi.js! (Make everything use Koishi.js)
// @author CyanChanges<contact@cyans.me>
// @match *://*/*
// @icon https://koishi.chat/logo.png
// @run-at document-body
// @grant none
// ==/UserScript==
@CyanChanges
CyanChanges / timer.py
Last active February 8, 2024 13:25
EMCAScript-like timer function (setTimeout, etc) for Python
# All rights reserved. Cyan Changes (c) 2024
# Licensed to zhuhansan666 & lovemilk-Inc(lovemilk-Inc@proton.me) under Apache-2.0 license.
import asyncio
import atexit
import datetime
import gc
import inspect
import threading
import warnings
@CyanChanges
CyanChanges / debounce.py
Created January 20, 2024 15:07
Python simple HMR
import functools
from threading import Timer
def debounce(wait):
""" Decorator that will postpone a functions
execution until after wait seconds
have elapsed since the last time it was invoked. """
def decorator(fn):
@CyanChanges
CyanChanges / README.md
Last active June 16, 2025 09:35
Take down `https://www.soraacg.com/` 's devtools detector
@CyanChanges
CyanChanges / dfpwm.c
Last active December 26, 2023 09:12
DFPWM convertor C extension for Python
This file has been truncated, but you can view the full file.
/* Generated by Cython 3.0.7 */
/* BEGIN: Cython Metadata
{
"distutils": {
"depends": [],
"name": "dfpwm",
"sources": [
"./dfpwm.pyx"
]