Skip to content

Instantly share code, notes, and snippets.

View rain2307's full-sized avatar
๐ŸŽฏ
Focusing

rain2307

๐ŸŽฏ
Focusing
View GitHub Profile
ๆ นๆฎUnicode5.0ๆ•ด็†ๅฆ‚ไธ‹๏ผš
1๏ผ‰ๆ ‡ๅ‡†CJKๆ–‡ๅญ—
http://www.unicode.org/Public/UNIDATA/Unihan.html
2๏ผ‰ๅ…จ่ง’ASCIIใ€ๅ…จ่ง’ไธญ่‹ฑๆ–‡ๆ ‡็‚นใ€ๅŠๅฎฝ็‰‡ๅ‡ๅใ€ๅŠๅฎฝๅนณๅ‡ๅใ€ๅŠๅฎฝ้Ÿฉๆ–‡ๅญ—ๆฏ๏ผšFF00-FFEF
http://www.unicode.org/charts/PDF/UFF00.pdf
3๏ผ‰CJK้ƒจ้ฆ–่กฅๅ……๏ผš2E80-2EFF
http://www.unicode.org/charts/PDF/U2E80.pdf
@rain2307
rain2307 / tracing.rs
Created August 24, 2023 00:03
init tracing
use tracing_appender;
use tracing_error::ErrorLayer;
use tracing_subscriber::{self, fmt, prelude::*, registry::Registry};
pub fn init_tracing(directory: &str, file_name: &str) -> tracing_appender::non_blocking::WorkerGuard {
let file_appender = tracing_appender::rolling::hourly(directory, file_name);
let (non_blocking, guard) = tracing_appender::non_blocking(file_appender);
let file_log =
fmt::layer().with_ansi(false).with_thread_names(true).with_line_number(true).with_writer(non_blocking).pretty();
@rain2307
rain2307 / Cargo.toml
Created August 27, 2023 02:21
dll.rs
[target.'cfg(windows)'.dev-dependencies]
windows = { version = "0.48.0", features = [
"Win32_System_LibraryLoader",
"Win32_Foundation",
] }
#!/bin/bash
# MIT License
# Copyright (c) 2022-present MoyuScript
# See: https://mit-license.org/
echo "Input path: $1"
echo "With subset: $2"
echo "Custom text file: $3"
@rain2307
rain2307 / docker-registry-mirrors.md
Last active February 7, 2024 11:55 — forked from y0ngb1n/docker-registry-mirrors.md
ๅ›ฝๅ†…็š„ Docker Hub ้•œๅƒๅŠ ้€Ÿๅ™จ๏ผŒ็”ฑๅ›ฝๅ†…ๆ•™่‚ฒๆœบๆž„ไธŽๅ„ๅคงไบ‘ๆœๅŠกๅ•†ๆไพ›็š„้•œๅƒๅŠ ้€ŸๆœๅŠก | Dockerized ๅฎž่ทต https://github.com/y0ngb1n/dockerized

Docker Hub ้•œๅƒๅŠ ้€Ÿๅ™จ

ๅ›ฝๅ†…ไปŽ Docker Hub ๆ‹‰ๅ–้•œๅƒๆœ‰ๆ—ถไผš้‡ๅˆฐๅ›ฐ้šพ๏ผŒๆญคๆ—ถๅฏไปฅ้…็ฝฎ้•œๅƒๅŠ ้€Ÿๅ™จใ€‚Docker ๅฎ˜ๆ–นๅ’Œๅ›ฝๅ†…ๅพˆๅคšไบ‘ๆœๅŠกๅ•†้ƒฝๆไพ›ไบ†ๅ›ฝๅ†…ๅŠ ้€Ÿๅ™จๆœๅŠกใ€‚

Dockerized ๅฎž่ทต https://github.com/y0ngb1n/dockerized

้…็ฝฎๅŠ ้€Ÿๅœฐๅ€

Ubuntu 16.04+ใ€Debian 8+ใ€CentOS 7+

@rain2307
rain2307 / rust-command-line-utilities.markdown
Created January 28, 2024 15:39 — forked from sts10/rust-command-line-utilities.markdown
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
#!/bin/bash
# Pre-commit hook for Rust project
# This hook runs cargo fmt and cargo clippy before allowing commits
set -e
echo "Running cargo fmt..."
cargo fmt -- --check
if [ $? -ne 0 ]; then