Skip to content

Instantly share code, notes, and snippets.

View kidonng's full-sized avatar
You're absolutely right!

Kid kidonng

You're absolutely right!
View GitHub Profile
@kidonng
kidonng / profit.jpg
Last active September 8, 2025 11:18
profit.jpg
@kidonng
kidonng / sing-box-sub.ts
Created August 15, 2025 14:33
Usage: deno run -A sing-box-sub.ts --address <address> --secret $(uuidgen) out </etc/sing-box/config.json
import { readAllSync } from "jsr:@std/[email protected]";
import { ensureDirSync } from "jsr:@std/[email protected]";
import { join } from "jsr:@std/[email protected]";
import { v5 } from "jsr:@std/[email protected]";
import { parseArgs } from "jsr:@std/[email protected]";
// https://sing-box.sagernet.org/manual/proxy-protocol/shadowsocks/#server-example
interface SingBoxConfig {
inbounds: SingBoxInbound[];
}
#! /usr/bin/env bash
# More info at: https://github.com/elitak/nixos-infect
set -e -o pipefail
makeConf() {
# Skip everything if main config already present
[[ -e /etc/nixos/configuration.nix ]] && return 0
/* eslint-disable @typescript-eslint/restrict-plus-operands */
import stripIndent from 'https://esm.sh/strip-indent'
// https://sw.kovidgoyal.net/kitty/conf/#the-color-table
const ansi = [
'black',
'red',
'green',
'yellow',
'blue',
import {extname} from 'path'
import {build, stop} from 'esbuild'
import {solidPlugin} from 'esbuild-plugin-solid'
import {denoPlugin} from 'esbuild_deno_loader'
const [input] = Deno.args
const ext = extname(input)
const compileOutput = input.replace(ext, '.compiled.js')
const bundleOutput = input.replace(ext, '.bundle.js')