Skip to content

Instantly share code, notes, and snippets.

View discountry's full-sized avatar
📕
Learning

Disney discountry

📕
Learning
View GitHub Profile
#!/usr/bin/env bash
set -e
echo "==> Updating apt..."
sudo apt update
echo "==> Installing Chinese fonts (Noto CJK + WenQuanYi)..."
sudo apt install -y \
fontconfig \
fonts-noto-cjk \
{
"spinnerVerbs": {
"mode": "replace",
"verbs": [
"Shuffling Cards",
"Polishing Mana Crystals",
"Filling Up Loading Bar",
"Sweeping Up Minion Dust",
"Installing New Timer Fuse",
"Gathering Spectators",
"browser": {
"enabled": true,
"controlUrl": "http://127.0.0.1:18791",
"executablePath": "/usr/bin/google-chrome-stable",
"headless": true,
"noSandbox": true,
"defaultProfile": "clawd",
"profiles": {
"clawd": {
"cdpPort": 18800,
paths
**/*.{ts,tsx}

React Dev Principles

  1. Purity & Architecture
  • Render must be pure/deterministic: same inputs → same JSX.
  • Must be StrictMode-safe: no side effects in render (no mutations/API calls).
  • Keep render logic separate from event handlers.

Software Engineering Philosophy & Development Protocol

1. Global Integrity & Topology

  • System Awareness: Before implementation, map the dependency graph and system topology. Ensure local changes preserve global invariants and do not trigger "Shotgun Surgery."
  • Orthogonality: Design for independence. Ensure that changes in one module do not leak side effects into others. Minimize coupling and maximize cohesion.

2. Intent & Abstraction Hierarchy

  • Intent-Revealing Design: Prioritize human readability and intent over machine cleverness. Use naming that explains "Why" rather than "How."
  • Single Level of Abstraction (SLA): Adhere strictly to the Single Responsibility Principle (SRP). Each function must operate at a consistent level of abstraction and have exactly one reason to change.
// 建议先刷新网页停止旧脚本,再运行此脚本
var autoBilingual = setInterval(function() {
// --- 1. 侦测市场趋势 ---
// 检查是否有向上趋势的图标 (lucide-trending-up)
const marketIsGoingUp = document.querySelector('span svg.lucide-trending-up') !== null;
// --- 2. 制定反向策略 (定义目标关键词) ---
// 逻辑:涨了就买跌/Short,跌了就买涨/Long
let targetKeywords = [];
@discountry
discountry / antigravity.json
Created January 7, 2026 04:08
cursor/antigravity/vscode one key push to git
{
"key": "cmd+enter",
"command": "runCommands",
"args": {
"commands": [
{
"command": "git.stageAll"
},
{
"command": "antigravity.generateCommitMessage"
@discountry
discountry / eth-gas-tracker.js
Created December 20, 2025 13:26
scriptable eth-gas-tracker
// ============================================
// ETH Gas Elite Widget (v6.1 - Enhanced Breathing Room)
// - 1x1 专项优化:显著增加全局边距,提升呼吸感与留白艺术
// - 结构:顶部胶囊价格 + 中部大字 + 底部独立玻璃卡片
// - 背景:彩色高斯模糊弥散背景
// ============================================
const ETHERSCAN_API_BASE = "https://api.etherscan.io/v2/api";
const KEYCHAIN_KEY = "ETHERSCAN_API_KEY_V2";
const BINANCE_PRICE_URL = "https://api.binance.com/api/v3/ticker/price?symbol=ETHUSDT";
//@version=6
indicator("BTC-ZEC RSI Div", overlay=true)
// === Inputs ===
symA = input.symbol("BITSTAMP:BTCUSD", "Symbol A")
symB = input.symbol("BITFINEX:ZECUSD", "Symbol B")
res = input.timeframe("", "Resolution (empty = chart)")
rsiLen = input.int(14, "RSI Length", minval=2)
len = input.int(20, "Z-Score Length", minval=10)
smooth = input.int(5, "EMA Smoothing", minval=1)
// scan-polymarket-orderbook.ts
// 运行: npx tsx scan-polymarket-orderbook.ts
// 或: npx ts-node scan-polymarket-orderbook.ts (需安装 ts-node/typescript)
import * as readline from "node:readline";
type PMEvent = { slug?: string; title?: string };
type Market = {
id: string;
question: string;