Skip to content

Instantly share code, notes, and snippets.

@JaHIY
JaHIY / .tmux.conf
Last active September 11, 2025 12:58
minimal tmux.conf
# ----------------------------
# 基础设置
# ----------------------------
# 将重载配置的快捷键绑定为 prefix r[1](@ref)
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# 设置终端支持256色[3,4](@ref)
set -g default-terminal "tmux-256color"
# ----------------------------
@JaHIY
JaHIY / .bashrc
Created September 6, 2025 03:37
minimal bashrc
# ========================
# 1. 基础配置与环境变量
# ========================
# 如果不是交互式 Shell,则停止执行
[[ $- != *i* ]] && return
# 设置默认文本编辑器
export EDITOR='vim'
export VISUAL='vim'
@JaHIY
JaHIY / init.el
Last active August 24, 2025 06:55
minimal emacs config
;;; -*- mode: emacs-lisp; coding: utf-8-unix -*-
;;;; 1. 核心性能优化
(setq inhibit-startup-screen t) ; 禁用欢迎页
(setq initial-scratch-message nil) ; 清空 *scratch* 内容
(setq gc-cons-threshold 100000000) ; 提升 GC 阈值加速启动
(setq read-process-output-max (* 4 1024)) ; 增加进程输出缓存
(fset 'yes-or-no-p 'y-or-n-p) ; 用 y/n 替代 yes/no
;;;; 2. 编码与字符集
@JaHIY
JaHIY / .vimrc
Created August 24, 2025 06:26
minimal vimrc
" ==================== 核心跨平台配置 ====================
set nocompatible " 禁用 Vi 兼容模式
set fileencodings=utf-8,gbk,cp936,bigucs,latin1 " 中文编码兼容
" === 平台差异化设置 ===
if has('win32') " Windows 专属配置
source $VIMRUNTIME/mswin.vim " 启用 Windows 快捷键(Ctrl+C/V)
behave mswin " 鼠标模式适配 Windows
endif
@JaHIY
JaHIY / main.groovy
Created April 9, 2024 06:56
bilibili-emote-downloader
import groovy.json.JsonSlurper
def download(URL from, File to) {
if (to.exists()) {
println "Skip `${to.canonicalPath}`";
} else {
to.createParentDirectories();
println "Download `${to.canonicalPath}` from `${from.toString()}`";
to << from.openStream();
}
@JaHIY
JaHIY / PKGBUILD
Last active February 17, 2024 08:03
AUR PKGBUILD for Floorp
# Maintainer: NSK-1010 <kotone[dot]olin1010[at]gmail[dot]com>
# Contributor: Kars Wang <jaklsy[at]gmail[dot]com>
## useful links
# http://floorp.app/
# https://github.com/Floorp-Projects/Floorp
## basic info
pkgname=floorp
pkgver=11.9.0
@JaHIY
JaHIY / PKGBUILD
Last active October 20, 2023 08:18
AUR PKGBUILD for CP2K 2023.2
# Maintainer: Viktor Drobot (aka dviktor) <linux776 [at] gmail [dot] com>
# Maintainer: Anton Kudelin <kudelin [at] protonmail [dot] com>
# Contributor: Kars Wang <jaklsy [at] gmail [dot] com>
pkgname=cp2k
pkgver=2023.2
_dbcsrver=2.6.0
pkgrel=1
# NVIDIA GPU Generation: Kepler, Pascal, or Volta;
# please specify one closest to yours or leave unchanged
@JaHIY
JaHIY / case_data_index.py
Last active July 6, 2022 07:47
format quote in case_data_index.json
import json
import re
from functools import reduce
PATTERNS = [
'^(.*"BRIEF_CASE":")(.*)(","CASE_TYPE":.*)$',
'^(.*"CASE_ADDRESS":")(.*)("},"ADDR_TYPE":.*)$',
'^(.*"case_?[Aa]ddress":")(.*)(","table_?[Ss]ource":.*)$',
'^(.*"caseAddress":")(.*)(","locationJson":.*)$',
'^(.*"CASE_NAME":")(.*)(","CASE_NUMBER":.*)$',
@JaHIY
JaHIY / bilibili_emoji_downloader.rb
Last active May 30, 2022 16:30
bilibili emoji downloader
#!/usr/bin/env ruby
require 'fileutils'
require 'json'
require 'net/http'
$download_dir = 'bilibili_emojis'
$cookie = 'SESSDATA=PUT_YOUR_SESSDATA_HERE'
def download(url, filename)
@JaHIY
JaHIY / scape_goat_tree.cpp
Created May 7, 2022 10:04
Yet another C++ implementation of ScapeGoat Tree
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
#include <utility>
using std::make_pair;
using std::pair;
#include <functional>