Hexo-Keep Integrated Test

Comprehensive Markdown Test Document This document tests all major Markdown features including complex combinations. Use it to validate HTML conversion completeness. Table of Contents Text Formatting Lists Code Links & Images Tables Blockquotes Horizontal Rules Task Lists Footnotes Definition Lists Math Emojis & Mentions Special Characters Mermaid Diagrams Mixed HTML Edge Cases Text Formatting Bold, italic, strikethrough, inline code, nested combinations. Headers H1 able bank castle dog easy H1 able bank castle dog easy H2 able bank castle dog easy H2 able bank castle dog easy H3 able bank castle dog easy H3 able bank castle dog easy H4 able bank castle dog easy H4 able bank castle dog easy H5 able bank castle dog easy H5 able bank castle dog easy H6 able bank castle dog easy H6 able bank castle dog easy Lists Nested Mixed Lists First ordered item Nested unordered Sub-nested asterisk Sub-sub-nested plus Second ordered 1# Code block in list 2print("Hello World") Third ordered Continuation line Task List Completed task Pending task Subtask Code Fenced Code with Syntax Highlighting 1def fibonacci(n): 2 if n <= 1: 3 return n 4 else: 5 return fibonacci(n-1) + fibonacci(n-2) Diff Highlighting 1- deleted_line = True 2+ added_line = False Links & Images Variants Standard Link Title Link Reference Link ...

May 12, 2025 · 41 min · 8607 words · xxraincandyxx

Python Argparse

Python argparse General Use Guide argparse is Python’s standard library module for creating command-line interfaces. It’s a powerful tool for parsing command-line arguments and generating help messages. Basic Usage Pattern 1import argparse 2 3# 1. Create the parser 4parser = argparse.ArgumentParser(description='Description of your program') 5 6# 2. Add arguments 7parser.add_argument('--foo', help='foo help') 8parser.add_argument('bar', help='bar help') 9 10# 3. Parse the arguments 11args = parser.parse_args() 12 13# 4. Use the arguments 14print(args.foo) 15print(args.bar) Adding Arguments Positional Arguments 1parser.add_argument('filename', help='name of the file to process') Optional Arguments 1parser.add_argument('--verbose', '-v', help='increase output verbosity', action='store_true') Common Argument Types 1# String (default) 2parser.add_argument('--name', type=str, help='person name') 3 4# Integer 5parser.add_argument('--age', type=int, help='person age') 6 7# Float 8parser.add_argument('--price', type=float, help='item price') 9 10# Boolean flags 11parser.add_argument('--enable', action='store_true', help='enable feature') 12parser.add_argument('--disable', action='store_false', help='disable feature') 13 14# Choices 15parser.add_argument('--color', choices=['red', 'green', 'blue'], help='color choice') 16 17# Multiple values 18parser.add_argument('--numbers', nargs='+', type=int, help='list of numbers') Advanced Options 1# Required arguments 2parser.add_argument('--required-arg', required=True, help='this argument is required') 3 4# Default values 5parser.add_argument('--delay', type=int, default=10, help='delay in seconds') 6 7# Custom actions 8parser.add_argument('--version', action='version', version='%(prog)s 1.0') 9 10# Argument groups 11group = parser.add_argument_group('authentication') 12group.add_argument('--username', help='username') 13group.add_argument('--password', help='password') Parsing and Using Arguments 1args = parser.parse_args() 2 3# Access argument values 4if args.verbose: 5 print("Verbose mode enabled") 6 7if args.filename: 8 process_file(args.filename) Subcommands For complex CLI tools with multiple commands (like git): ...

May 12, 2025 · 3 min · 569 words · xxraincandyxx

Git Authentication Guide

Generate a new Authentication Token 1. Generate a New GitHub Personal Access Token (PAT) Step 1: Go to GitHub Developer Settings Open GitHub in your browser and log in. Go to Settings (click your profile icon in the top right and select “Settings”). Scroll down and find Developer settings (on the left sidebar). Click Personal access tokens > Fine-grained tokens (recommended). Step 2: Generate a New Token Click Generate new token (Fine-grained token). Set a note for the token (e.g., “Git CLI access”). Set an expiration date (or “No expiration” if you want it permanent). Under Permissions, select: repo → Read and Write (for full repo access). workflow → Read and Write (if using GitHub Actions). Click Generate token. {% note danger %} ⚠ Important: Copy the token immediately! You won’t be able to see it again. {% endnote %} ...

April 22, 2025 · 6 min · 1133 words · xxraincandyxx

Pybind11 Stubgen Guide

1. Where to Set output_dir for pybind11-stubgen? The output_dir is where the generated .pyi file will be saved. It does not affect Python’s ability to import the module—the .pyi file is just for type hints and documentation (used by IDEs like VSCode/PyCharm). Example 1pybind11-stubgen my_module -o ./stubs This generates ./stubs/my_module.pyi. Python will still import my_module from wherever the .so file is located (e.g., build/lib.linux-x86_64-3.8/). 2. How to Specify .so Output Directory in CMake? In your CMakeLists.txt, you can control where the .so file is built using: ...

April 16, 2025 · 2 min · 426 words · xxraincandyxx

Git Commits

Rewrite Old Commits with the Correct Info If you already made commits with the wrong name/email and you want to fix your commit history, follow this: 1git filter-branch --env-filter ' 2OLD_EMAIL="wrong@email.com" 3CORRECT_NAME="Your Correct Name" 4CORRECT_EMAIL="your.correct@email.com" 5 6if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]; then 7 export GIT_COMMITTER_NAME="$CORRECT_NAME" 8 export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" 9fi 10if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]; then 11 export GIT_AUTHOR_NAME="$CORRECT_NAME" 12 export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" 13fi 14' --tag-name-filter cat -- --branches --tags Rewrite every commit with the correct identity This doesn’t care what the old name/email was — it just replaces everything! 💥 ...

April 7, 2025 · 1 min · 153 words · xxraincandyxx