algorithm
Posted on
Edited on
排序算法
冒泡排序
1 | const main = () => { |
快速排序
1 | const arr = [3, 7, 8, 4, 5, 1, 2, 6, 9]; |
插入排序
1 | const arr = [3, 7, 8, 4, 5, 1, 2, 6, 9]; |
链表算法
删除链表的第 N 个节点
1 | var removeNthFromEnd = function (head, n) { |
递归算法
blender
Posted on
模型导出适配Unity
1. 导出前的核心准备(必须做)
在 Blender 的物体模式(Object Mode)下:
- 选中模型。
- 按下 Ctrl + A。
- 选择 **所有变换 (All Transforms)**。
重要:这一步是为了确保物体的初始旋转值为 0,缩放为 1,否则导出的轴向配置会失效。
2. FBX 导出面板配置
在 File > Export > FBX 窗口的右侧设置栏中,修改以下参数:
Transform(变换)选项卡
这是解决轴向问题的核心:
- Apply Scalings(应用缩放):改为 FBX All(非常重要,防止 Unity 里出现 100 倍缩放)。
- Forward(前进方向):选择 -Z Forward。
- Up(向上方向):选择 Y Up。
- Apply Unit(应用单位):勾选。
- Use Space Transform(使用空间变换):务必勾选。
Geometry(几何体)选项卡
- Smoothing(平滑):设置为 Face(防止法线在 Unity 里看起来硬邦邦)。
- Apply Modifiers(应用修改器):勾选。
c#
Posted on
Edited on
openGL
Posted on
Edited on
resume
Posted on
Edited on
shell
Posted on
Edited on
Mac
Git
查看 ts 文件增删记录
1
2date="2025-04-29";authorName=$(git config user.name);git log --all --author=${authorName} --since="${date} 00:00:00" --until="${date} 23:59:59" --pretty=tformat: --numstat | awk '$3 ~ /\.ts$/ { add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
查看所有提交记录
1
date="2025-02-20";authorName=$(git config user.name);git log --source --all --author="${authorName}" --since="${date}" --until="${date} 23:59:59" --oneline --graph --decorate
System
- 查看应用内存使用
1
ps -axo rss,comm | grep 'Google Chrome' | awk '{sum+=$1} END {print sum/1024 " MB"}'
Ubuntu
Certbot
- 自动部署,添加nginx配置
1
2sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d {url} - 只生成证书
1
sudo certbot certonly --standalone -d dice.dogeggs.cn
snacks
Posted on
software
Posted on
Edited on