Skip to content

Instantly share code, notes, and snippets.

View cherishyuan's full-sized avatar
🎨
Focusing

orange cherishyuan

🎨
Focusing
View GitHub Profile
@xuyuquan
xuyuquan / yuquan_mihomo.js
Last active May 7, 2026 01:21
clashpart覆写
/*!
powerfullz 的 Substore 订阅转换脚本
https://github.com/powerfullz/override-rules
支持的传入参数:
- loadbalance: 启用负载均衡(url-test/load-balance,默认 false)
- landing: 启用落地节点功能(如机场家宽/星链/落地分组,默认 false)
- ipv6: 启用 IPv6 支持(默认 false)
- full: 输出完整配置(适合纯内核启动,默认 false)
- keepalive: 启用 tcp-keep-alive(默认 false)
#include <stdio.h>
#include <stdlib.h>
#define da_append(xs, x) \
do { \
if ((xs)->count >= (xs)->capacity) { \
if ((xs)->capacity == 0) (xs)->capacity = 256; \
else (xs)->capacity *= 2; \
(xs)->items = realloc((xs)->items, (xs)->capacity*sizeof(*(xs)->items)); \
} \
@puhitaku
puhitaku / .clang-format
Last active April 7, 2024 06:49 — forked from pganssle/.clang-format
Clang format style that approximates PEP 7
# Forked from https://gist.github.com/pganssle/0e3a5f828b4d07d79447f6ced8e7e4db
# Licensed under MIT License which the author permits to release with.
# Copyright 2024 Takumi Sueda
# Copyright 2019 Paul Ganssle
# A clang-format style that approximates Python's PEP 7
# Useful for IDE integration
BasedOnStyle: Google
AlwaysBreakAfterReturnType: AllDefinitions
AllowShortIfStatementsOnASingleLine: false
@saiccoumar
saiccoumar / fit_tanh.py
Last active July 21, 2024 05:20
Fitting the tanh function
import pandas as pd
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
import sympy as sp
from pandas.plotting import table
@RealTong
RealTong / ubuntu-init-setup-script
Last active April 7, 2024 04:59
Linux(Ubuntu) init setup script
#!/bin/bash
# 变量
YUBIKEY5CNFC_PUBLIC_KEY="sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIDjFtyHmKX9UovGeZvQhyy7tSKcKVyMMWsZqgcO6QpXcAAAABHNzaDo= Realtong's Yubikey 5C NFC"
YUBIKEY5NFC_PUBLIC_KEY="sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHGPu9ys/hNYveYQeJYtYIGfoedzWPPKsswMTc8prhxSAAAABHNzaDo= Realtong's Yubikey 5 NFC"
echo -e "\n🔍 检测依赖...\n"
# Check if curl is installed
if ! command -v curl &> /dev/null
@numpde
numpde / add_pwd_to_path.sh
Created November 6, 2023 10:44
Add current path to $PATH
#!/bin/bash
# This script will add the directory where it is located to the PATH
# if it's not already included.
# Get the directory of the current script, regardless of where it's called from
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Check if the directory is already in PATH
if [[ ":$PATH:" != *":$DIR:"* ]]; then
# Add the script directory to PATH for the duration of this session or
@adamheins
adamheins / pyb_friction_demo.py
Created November 5, 2023 21:29
PyBullet planar friction demo
import numpy as np
import pybullet as pyb
import pybullet_data
def make_box(
position, half_extents, orientation=(0, 0, 0, 1), mass=1.0, color=(1, 0, 0, 1)
):
collision_uid = pyb.createCollisionShape(
shapeType=pyb.GEOM_BOX,
@rotemgrim
rotemgrim / NerdFonts.sh
Created November 5, 2023 16:14
Nerd fonts
# install nerd fonts:
declare -a fonts=(
# BitstreamVeraSansMono
# CodeNewRoman
# DroidSansMono
FiraCode
FiraMono
# Go-Mono
# Hack
# Hermit
@cmower
cmower / draw_frame_pybullet.py
Created June 14, 2023 18:04
Draw a frame in PyBullet.
import pybullet as p
import numpy as np
def draw_frame(T: np.ndarray) -> None:
""" Draw a frame represented by the 4-by-4 homogenous transformation matrix T."""
for i in range(3):
color = [0, 0, 0]
color[i] = 1
p.addUserDebugLine(
lineFromXYZ=T[:3, 3],
@CHIZI-0618
CHIZI-0618 / PuerNya_sing-box_fakeip_client_config.jsonc
Last active February 12, 2026 16:21
sing-box 带有 Proxy Providers 的客户端配置示例
{
"log": {
"level": "info",
"output": "sing-box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "cloudflare",