Skip to content

Instantly share code, notes, and snippets.

View doitian's full-sized avatar
🎯
Focusing

ian doitian

🎯
Focusing
View GitHub Profile

Mint Gate — Mentor Review

Overall verdict

Mint Gate is a viable MVP for CKB: wallet connect, community creation, paid join, and gated link delivery all work as a coherent story. The core idea — prove membership with on-chain activity, serve gated content off-chain — is a sensible semi-decentralized pattern for Nervos.

The project is not mainnet-ready yet. The biggest risks are inconsistent chain/DB state (create and join both write on-chain before the database), misleading “delete” language when only the database row is removed, and access control that ultimately trusts the API rather than the chain. Fix those before adding marketplace, on-chain chat, or optional xUDT/NFT layers on top of membership cells.

Problems

@doitian
doitian / registries.conf
Last active April 29, 2026 11:46
[Configure Docker Hub mirror in /etc/containers/registries.conf] #docker #podman #proxy
unqualified-search-registries = ['docker.io']
[[registry]]
prefix = "docker.io"
location = "docker.io"
[[registry.mirror]]
prefix = "docker.io"
# This will set the docker registry mirror of a chinese university.
# DON'T use it unless you have a network connection issue and you trust the mirror provider.
@doitian
doitian / parse_usbpcap.py
Created April 28, 2026 10:51
Parse USBPcap captures of the Ulanzi Stream Controller D200X (vid 2207 pid 0019); decodes the 7c7c framing layer and flags host->device frames sent before the first input event as candidates for the firmware's input-enable opcode. Companion to https://github.com/doitian/ulanzi-studio-niri
#!/usr/bin/env python3
"""Extract host->device packets to the Ulanzi D200X from a USBPcap capture.
Pure stdlib; runs on either Linux or Windows. Reads a PCAP/PCAPNG file
captured by USBPcap (https://desowin.org/usbpcap/) and prints every
URB submitted FROM the host TO an endpoint of vid:pid 2207:0019, decoding
the framing layer used by the device:
magic 7c 7c | command_protocol (BE u16) | length (LE u32) | payload
@doitian
doitian / sniff_official_app_windows.py
Created April 28, 2026 10:37
Pure-stdlib Windows HID sniffer for Ulanzi D200X (vid 2207 pid 0019); helps reverse-engineer the official Ulanzi app's startup handshake to unlock 4th-row + encoder input. Companion to https://github.com/doitian/ulanzi-studio-niri
#!/usr/bin/env python3
"""Sniff Ulanzi D200X HID input on Windows while the official app is running.
Pure-stdlib: uses ctypes against setupapi.dll + hid.dll (both ship with
Windows). No pip install, no admin needed for HID-level reads.
================================================================================
Goal
================================================================================
Capture what the official Ulanzi Stream Controller app does that makes the
@doitian
doitian / analogy-between-list-of-vectors-and-list-of-subspaces.md
Last active November 20, 2025 00:36
List of Vectors vs List of Subspaces

This query asks for a comparison between a list of vectors and a list of subspaces based on the concepts established in the sources, particularly regarding properties like span, linear independence, and basis.

Both lists of vectors and lists of subspaces are fundamental building blocks used to describe and structure a vector space $V$. They share analogies rooted in set theory, especially concerning how they generate or combine to form larger structures, but they differ fundamentally in the nature of their elements.

Here is a comparison based on the source material:

1. Fundamental Nature of Elements

Feature List of Vectors ($v_1, \dots, v_m$) List of Subspaces ($V_1, \dots, V_m$)
@doitian
doitian / ractor-fsm.rs
Created November 17, 2025 11:26
Ractor FSM
#[derive(Debug, Clone)]
enum ConnectionState {
Disconnected,
Connecting { attempts: u32 },
Connected { session_id: String },
Reconnecting { last_session: String },
}
enum FSMMessage {
Connect,
#!/bin/bash
# Script to delete AWS Glacier archives with retry logic and resume functionality
# Usage: ./delete-glacier-archives.sh [resume_archive_id]
#
# The script reads archive IDs from the provided file and deletes them one by one
# If an archive deletion fails, it prints the error and retries
# The script can resume from a specific archive ID if provided as an argument
set -euo pipefail
@doitian
doitian / MongoJson.scala
Created May 10, 2013 15:12
Convert play2.0 JsValue to mongodb DBObject provided by casbah
package module.db;
import com.mongodb.casbah.Imports._
import java.text.DateFormat
import java.util.Date
import play.api.data.validation.ValidationError
import play.api.libs.json._
object MongoJson {
def fromJson(json: JsValue) : JsResult[DBObject] = readDBObject.reads(json)
@doitian
doitian / unicodes.txt
Last active December 27, 2024 08:35
[unicodes.txt] Created from allkeys.txt http://www.unicode.org/Public/UCA/12.0.0/allkeys.txt
# 0000 # NULL (in ISO 6429)
 # 0001 # START OF HEADING (in ISO 6429)
 # 0002 # START OF TEXT (in ISO 6429)
 # 0003 # END OF TEXT (in ISO 6429)
 # 0004 # END OF TRANSMISSION (in ISO 6429)
 # 0005 # ENQUIRY (in ISO 6429)
 # 0006 # ACKNOWLEDGE (in ISO 6429)
 # 0007 # BELL (in ISO 6429)
 # 0008 # BACKSPACE (in ISO 6429)
# 0009 # HORIZONTAL TABULATION (in ISO 6429)