Skip to content

Instantly share code, notes, and snippets.

View jiahut's full-sized avatar
🎯
Focusing

zhijia,.zhang jiahut

🎯
Focusing
View GitHub Profile
This file has been truncated, but you can view the full file.
#!/usr/bin/env node
import { createRequire } from 'module'; const require = createRequire(import.meta.url); globalThis.__filename = require('url').fileURLToPath(import.meta.url); globalThis.__dirname = require('path').dirname(globalThis.__filename);
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
#!/usr/bin/env bun
// @bun
class K{defaultArch=["x64","amd64","arm64","aarch64","x86_64","universal"];defaultFileTypes=[".zip",".tar.gz",".exe",".dmg",".deb",".rpm",".AppImage"];async downloadLatest(k,q={},j=process.cwd()){try{let v=this.convertToApiUrl(k);console.log(`\uD83D\uDD0D \u83B7\u53D6\u6700\u65B0\u7248\u672C\u4FE1\u606F: ${v}`);let C=await this.fetchLatestRelease(v);if(console.log(`\uD83D\uDCE6 \u627E\u5230\u7248\u672C: ${C.tag_name} - ${C.name}`),C.assets.length===0){console.log("\u274C \u8BE5\u7248\u672C\u6CA1\u6709\u53EF\u4E0B\u8F7D\u7684\u8D44\u6E90\u6587\u4EF6");return}let E=this.filterAssets(C.assets,q);if(E.length===0){console.log("\u274C \u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u6587\u4EF6"),this.listAvailableAssets(C.assets);return}if(E.length===1)await this.downloadAsset(E[0],j);else{let F=await this.selectAsset(E);if(F)await this.downloadAsset(F,j);else console.log("\u274C \u672A\u9009\u62E9\u4EFB\u4F55\u6587\u4EF6\uFF0C\u53D6\u6D88\u4E0B\u8F7D")}}catch(v){console.error("\u274C \u4E0B\u
▶ cat dns-updater.bundle.js
▶ cat dns-updater.bundle.js
▶ cat dns-updater.bundle.js
@echo off
REM dns-updater.cmd - Windows wrapper to run dns-updater.bundle.js with bun
REM Usage: dns-updater.cmd [args]
REM Determine the directory of this script
set SCRIPT_DIR=%~dp0
REM Execute the bundled script using bun
bun "%SCRIPT_DIR%dns-updater.js" %*
This file has been truncated, but you can view the full file.
#!/usr/bin/env node
import { createRequire } from 'module'; const require = createRequire(import.meta.url); globalThis.__filename = require('url').fileURLToPath(import.meta.url); globalThis.__dirname = require('path').dirname(globalThis.__filename);
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
#!/usr/bin/env bash
set -euo pipefail
# markservman: 管理 markserv 服务的工具
# Usage: markservman {install|start|stop|status|logs}
action=${1:-}
case "$action" in
install)
echo "Installing markserv globally using bun..."
bun install -g markserv
#!/bin/sh
':' //; exec "$(command -v bun || command -v node)" "$0" "$@"
var vZ=Object.create;var{getPrototypeOf:PZ,defineProperty:GG,getOwnPropertyNames:_Z}=Object;var EZ=Object.prototype.hasOwnProperty;var XG=(A,Q,I)=>{I=A!=null?vZ(PZ(A)):{};let J=Q||!A||!A.__esModule?GG(I,"default",{value:A,enumerable:!0}):I;for(let $ of _Z(A))if(!EZ.call(J,$))GG(J,$,{get:()=>A[$],enumerable:!0});return J};var cA=(A,Q)=>()=>(Q||A((Q={exports:{}}).exports,Q),Q.exports);var EA=import.meta.require;var CI=cA((gZ)=>{class _J extends Error{constructor(A,Q,I){super(I);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Q,this.exitCode=A,this.nestedError=void 0}}class CG extends _J{constructor(A){super(1,"commander.invalidArgument",A);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}gZ.CommanderError=_J;gZ.InvalidArgumentError=CG});var uI=cA((hZ)=>{var{InvalidArgumentError:yZ}=CI();class ZG{constructor(A,Q){switch(this.description=Q||"",this.variadic=!1,this.parseA
@jiahut
jiahut / config.toml
Created March 11, 2024 03:48
配置 helix 作为 vim 的最小实现
[editor]
auto-info = false
[keys.normal]
# Quick iteration on config changes
# C-o = ":config-open"
# C-r = ":config-reload"
";" = "repeat_last_motion"