Skip to content

Instantly share code, notes, and snippets.

View yinheli's full-sized avatar
:octocat:
Vibe Coding

yinheli yinheli

:octocat:
Vibe Coding
View GitHub Profile
@yinheli
yinheli / greeting-demo.html
Created April 9, 2026 15:41
Greeting animation effect - per-character blur/fade/scale transition, inspired by https://cai.im/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Greeting Animation</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
@yinheli
yinheli / update-dockerhub-readme.sh
Created April 7, 2026 20:05
Shell script to update Docker Hub repository README via API
#!/bin/sh
set -e
PAT="YOUR_PAT_HERE"
REPO="yinheli/cpdf"
README_FILE="$(dirname "$0")/note.md"
# Get JWT token
TOKEN=$(curl -sf -X POST "https://hub.docker.com/v2/users/login/" \
-H "Content-Type: application/json" \
@yinheli
yinheli / Dockerfile
Last active April 7, 2026 20:01
cpdf Docker Quick Reference - Build & use cpdf (Coherent PDF) via Alpine Docker image
FROM alpine:edge
RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk update \
&& apk add --no-cache cpdf
ENTRYPOINT ["cpdf"]
@yinheli
yinheli / Enable-Touch-ID-for-sudo.md
Last active February 6, 2026 01:49
Enable Touch ID for sudo on macOS

Enable Touch ID for sudo on macOS

macOS supports using Touch ID to authenticate sudo commands instead of typing your password.

Setup

Create or edit /etc/pam.d/sudo_local:

sudo vim /etc/pam.d/sudo_local
@yinheli
yinheli / output
Last active September 9, 2024 02:21
My mini desk PC, state
SMART Information for /dev/nvme0n1
--------------------------------------------------
| Metric | Value |
| -------------------- | ------------------------- |
| Temperature | 46 |
| Data Written | 4.38 TB |
| Data Read | 30.9 TB |
| Power On Hours | 19 |
--------------------------------------------------
Temperature Sensors: 50, 51, 52, 53, 54, 55, 56, 57
@yinheli
yinheli / Android_Emulator_AWS_EC2_ARM64_2022.txt
Created June 26, 2023 05:56 — forked from atyachin/Android_Emulator_AWS_EC2_ARM64_2022.txt
Running headless android emulator on AWS EC2 Ubuntu instance (ARM64 / aarch64) - 2022
Android Emulator (ARM64) on EC2 - 2022
---------------------------------------
1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64
2. sudo apt update && sudo apt upgrade
3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
4. wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
5. unzip commandlinetools-linux-8512546_latest.zip -d android-sdk
6. sudo mv android-sdk /opt/
7. mkdir /opt/android-sdk/cmdline-tools/latest
8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error)
@yinheli
yinheli / compress_pdf.md
Created April 20, 2022 11:15 — forked from ahmed-musallam/compress_pdf.md
How to compress PDF with ghostscript

How to compress PDF using ghostscript

As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!

to learn more abot ghostscript (gs): https://www.ghostscript.com/

What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.

credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9

#[cfg(test)]
mod tests_lifetime {
use std::future::Future;
async fn f(_x: &i32) {
()
}
// 写法 1
@yinheli
yinheli / short.md
Last active January 20, 2021 09:00
Codereview 中常见的缩写
TL;DR: Too Long; Don’t Read. PR 内容太多,没办法看
PR:Pull Request. 拉取请求,给其他项目提交代码
PTAL:Please take a look. 请看一看
LGTM: Looks Good To Me. 代码已经过 review,可以合并
SGTM: Sounds Good To Me. 和上面那句意思差不多,也是已经通过了 review 的意思
WIP: Work In Progress. 告诉项目维护者这个功能还未完成,方便维护者前 review 已提交的代码
PTAL: Please Take A Look. 提示项目 Owner/contributor review
TBR: To Be Reviewed. 提示维护者进行 review
TBD: To Be Done (or Defined/Discussed/Decided/Determined). 根据语境不同意义有所区别,但一般都是还没搞定的意思
import java.math.BigInteger;
import java.util.function.Function;
/**
* @author yinheli
*/
public class RSATest {
private static BigInteger[] commonE = new BigInteger[]{