{"config":{"lang":["zh","en"],"separator":"[\\s\\u200b\\u3000\\-\u3001\u3002\uff0c\uff0e\uff1f\uff01\uff1b]+","pipeline":["stemmer"],"fields":{"title":{"boost":1000.0},"text":{"boost":1.0},"tags":{"boost":1000000.0}}},"docs":[{"location":"","title":"\u6b22\u8fce\u6765\u5230\u6587\u6863\u7ad9 \ud83d\udc4b","text":"
\u57fa\u4e8e MkDocs + Material \u4e3b\u9898\u6784\u5efa\u7684\u4e2a\u4eba\u77e5\u8bc6\u5e93\uff0c\u5185\u5d4c\u4e8e Gitea \u81ea\u52a8\u90e8\u7f72\u3002
"},{"location":"#_2","title":"\u7279\u6027","text":"docs/ \u76ee\u5f55\u4e0b\u65b0\u5efa\u6216\u7f16\u8f91 .md \u6587\u4ef6mkdocs.yml \u7684 nav \u4e2d\u6dfb\u52a0\u5bfc\u822a\u6761\u76ee# \u672c\u5730\u9884\u89c8\nmkdocs serve\n\n# \u672c\u5730\u6784\u5efa\nmkdocs build\n"},{"location":"dev/","title":"\u5f00\u53d1","text":"\u5f00\u53d1\u76f8\u5173\u7b14\u8bb0\u4e0e\u6587\u6863\u3002
"},{"location":"dev/docker-notes/","title":"Docker \u7b14\u8bb0","text":""},{"location":"dev/docker-notes/#_1","title":"\u5e38\u7528\u547d\u4ee4","text":"# \u6784\u5efa\u955c\u50cf\ndocker build -t myapp:latest .\n\n# \u8fd0\u884c\u5bb9\u5668\ndocker run -d --name myapp -p 8080:80 myapp:latest\n\n# \u67e5\u770b\u65e5\u5fd7\ndocker logs -f myapp\n\n# \u8fdb\u5165\u5bb9\u5668\ndocker exec -it myapp sh\n\n# \u6e05\u7406\ndocker system prune -f\n"},{"location":"dev/docker-notes/#docker-compose","title":"Docker Compose","text":"services:\n web:\n image: nginx:alpine\n ports:\n - \"80:80\"\n volumes:\n - ./html:/usr/share/nginx/html\n restart: unless-stopped\n"},{"location":"dev/docker-notes/#_2","title":"\u5c0f\u6280\u5de7","text":"--cache-from \u52a0\u901f\u91cd\u590d\u6784\u5efa.dockerignore \u6392\u9664 .git\u3001node_modules \u7b49git status \u67e5\u770b\u5de5\u4f5c\u533a\u72b6\u6001 git add -A \u6682\u5b58\u6240\u6709\u53d8\u66f4 git commit -m \"msg\" \u63d0\u4ea4 git push origin main \u63a8\u9001\u5230\u8fdc\u7aef git pull --rebase \u62c9\u53d6\u5e76\u53d8\u57fa git stash \u6682\u5b58\u672a\u63d0\u4ea4\u7684\u6539\u52a8"},{"location":"dev/git-workflow/#_2","title":"\u5206\u652f\u7b56\u7565","text":"main \u2500\u2500\u25cf\u2500\u2500\u25cf\u2500\u2500\u25cf\u2500\u2500\u25cf\u2500\u2500\u25cf\u2500\u2500 (\u751f\u4ea7)\n \\ /\nfeature/xxx \u2500\u2500\u25cf\u2500\u2500\u25cf\u2500\u2500\u25cf\u2500\u2500 (\u529f\u80fd\u5206\u652f)\n main \u5206\u652f\u59cb\u7ec8\u53ef\u90e8\u7f72main \u62c9\u51fa\uff0c\u5b8c\u6210\u540e Merge Request \u5408\u5165\u5b66\u4e60\u7b14\u8bb0\u4e0e\u77e5\u8bc6\u6574\u7406\u3002
"},{"location":"learn/algorithms/","title":"\u7b97\u6cd5\u7b14\u8bb0","text":""},{"location":"learn/algorithms/#_2","title":"\u6392\u5e8f\u7b97\u6cd5\u5bf9\u6bd4","text":"\u7b97\u6cd5 \u5e73\u5747 \u6700\u574f \u7a7a\u95f4 \u7a33\u5b9a \u5192\u6ce1\u6392\u5e8f O(n\u00b2) O(n\u00b2) O(1) \u2705 \u5feb\u901f\u6392\u5e8f O(n log n) O(n\u00b2) O(log n) \u274c \u5f52\u5e76\u6392\u5e8f O(n log n) O(n log n) O(n) \u2705 \u5806\u6392\u5e8f O(n log n) O(n log n) O(1) \u274c"},{"location":"learn/algorithms/#_3","title":"\u5feb\u901f\u6392\u5e8f\u793a\u4f8b","text":"def quicksort(arr):\n if len(arr) <= 1:\n return arr\n pivot = arr[len(arr) // 2]\n left = [x for x in arr if x < pivot]\n mid = [x for x in arr if x == pivot]\n right = [x for x in arr if x > pivot]\n return quicksort(left) + mid + quicksort(right)\n"},{"location":"learn/algorithms/#_4","title":"\u76f8\u5173\u94fe\u63a5","text":"\u8fd0\u7ef4\u76f8\u5173\u7b14\u8bb0\u4e0e\u6587\u6863\u3002
"},{"location":"ops/linux-commands/","title":"Linux \u5e38\u7528\u547d\u4ee4","text":""},{"location":"ops/linux-commands/#_1","title":"\u6587\u4ef6\u64cd\u4f5c","text":"# \u67e5\u627e\u6587\u4ef6\nfind / -name \"*.conf\" 2>/dev/null\n\n# \u78c1\u76d8\u4f7f\u7528\ndu -sh /var/log/*\ndf -h\n\n# \u5b9e\u65f6\u67e5\u770b\u65e5\u5fd7\ntail -f /var/log/syslog\n"},{"location":"ops/linux-commands/#_2","title":"\u8fdb\u7a0b\u7ba1\u7406","text":"# \u67e5\u770b\u7aef\u53e3\u5360\u7528\nss -tlnp | grep :80\nlsof -i :80\n\n# \u6740\u6b7b\u8fdb\u7a0b\nkill -9 $(lsof -t -i:80)\n\n# \u67e5\u770b\u8d44\u6e90\u5360\u7528\nhtop\n"},{"location":"ops/linux-commands/#_3","title":"\u7f51\u7edc","text":"# \u6d4b\u8bd5\u8fde\u901a\u6027\ncurl -I https://example.com\ntraceroute example.com\n\n# \u9632\u706b\u5899 (ufw)\nufw allow 80/tcp\nufw status\n"},{"location":"ops/nginx-config/","title":"Nginx \u914d\u7f6e","text":""},{"location":"ops/nginx-config/#_1","title":"\u57fa\u672c\u6a21\u677f","text":"server {\n listen 80;\n server_name docs.example.com;\n\n root /usr/share/nginx/html;\n index index.html;\n\n # SPA \u8def\u7531\u56de\u9000\n location / {\n try_files $uri $uri/ /index.html;\n }\n\n # \u9759\u6001\u8d44\u6e90\u7f13\u5b58\n location ~* \\.(js|css|png|jpg|svg|woff2)$ {\n expires 30d;\n add_header Cache-Control \"public, immutable\";\n }\n\n # Gzip \u538b\u7f29\n gzip on;\n gzip_types text/plain text/css application/json application/javascript;\n}\n"},{"location":"ops/nginx-config/#_2","title":"\u5e38\u7528\u64cd\u4f5c","text":"# \u6d4b\u8bd5\u914d\u7f6e\nnginx -t\n\n# \u91cd\u65b0\u52a0\u8f7d\uff08\u4e0d\u4e2d\u65ad\u670d\u52a1\uff09\nnginx -s reload\n"}]}