Skip to content

Instantly share code, notes, and snippets.

/-
三个观点,用类型编码(不是定理证明):
1. 觉悟 = 无明之灭。定义为否定。
其「反面」¬觉悟 = ¬¬无明。构造逻辑中 ¬¬无明 ↛ 无明
——双重否定不能消去。「不觉」比「无明」更弱,无法做实。
2. 烦恼依赖无明 → 觉悟拿掉地基,烦恼即灭。
用归纳类型编码:构造 fannao 必须首先提供 wuming。
@iacore
iacore / gist:7496f6d258fa491f5b31e441248c0572
Last active June 10, 2026 11:34
How bdwgc interacts with Zig programs

Zig and bdwgc

bdwgc (the Boehm-Demers-Weiser conservative GC) ships a first-class Zig build (build.zig + build.zig.zon in-tree, CI badges in README.md for zig build test, cross-compile, and zig format). The build exposes gc as a static/dynamic library artifact with the same flag matrix as the upstream CMake build. Calling convention macros (GC_CALL) are empty on all supported platforms; GC_API is extern __attribute__((visibility ("default"))) on GCC/clang. The C ABI is therefore fully Zig-friendly.

@iacore
iacore / gist:dfc4beaeb0153dc127238ab1d9746af8
Created November 1, 2023 22:07
all pride flag colors
#000000
#0035A9
#004BFF
#00821B
#008F72
#00B8E7
#00D769
#023670
#052127
#060634
@iacore
iacore / main.c
Last active October 12, 2023 09:53 — forked from sogaiu/main.c
sh/exec-slurp via janet_dostring (assuming spork is installed)
// build:
//
// gcc -O0 -g main.c -I$HOME/.local/include -L$HOME/.local/lib -ljanet
// run:
//
// export LD_LIBRARY_PATH=$HOME/.local/lib
// ./a.out
#include "janet.h"
@iacore
iacore / alt-tab-fix.reg
Created August 10, 2023 09:15
Wine Registry File that fixes the game freezing when switching windows in X11
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"UseTakeFocus"="N"
@iacore
iacore / dotenv.zig
Created July 28, 2023 19:44
Zig dotenv
pub const EnvMap = struct {
arena: std.heap.ArenaAllocator,
pairs: std.ArrayList(Pair),
pub const Pair = struct {
k: []const u8,
v: []const u8,
};
@iacore
iacore / readability.go
Last active March 20, 2024 11:49
Readability: Turn web page into plain text and image (from yarr)
// Copyright 2017 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package readability
import (
"bytes"
"errors"
"fmt"
@iacore
iacore / dinitctl.fish
Created June 25, 2023 09:49
dinitctl fish completion
# dinitctl
# Autogenerated from man page /usr/share/man/man8/dinitctl.8.gz
# Manually edited
set commands start stop status restart wake release unpin unload reload list shutdown add-dep rm-dep enable disable setenv
complete -f -c dinitctl -n "not __fish_seen_subcommand_from $commands" -l help -d 'Display brief help text and then exit'
complete -f -c dinitctl -n "not __fish_seen_subcommand_from $commands" -l version -d 'Display version and then exit'
complete -f -c dinitctl -n "not __fish_seen_subcommand_from $commands" -s s -l system -d 'Control the system init process (this is the default when run as root)'
complete -f -c dinitctl -n "not __fish_seen_subcommand_from $commands" -s u -l user -d 'Control the user init process (this is the default when not run as root)'
# (c) 04/11/2016, Rolf Rolles, Mobius Strip Reverse Engineering
import z3
import struct
# XOR key for src.bin
KEY_SECTOR = 0x37
# Counter position, as two words
CNTLO = 0
CNTHI = 0
import std/[cmdline, base64]
proc writePng(f: File; pngdata: string) =
let bytes = pngdata.encode
const CHUNK_SIZE = 4096
var remaining = bytes.len
var i = 0
while remaining > 0: