diff --git a/.github/workflows/snake.yml b/.github/workflows/snake.yml deleted file mode 100644 index 857f707..0000000 --- a/.github/workflows/snake.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: ๐Ÿ Python Snake - -on: - schedule: - - cron: "0 0 * * *" # 08:00 Asia/Shanghai - workflow_dispatch: - push: - branches: [main] - paths: - - ".github/workflows/snake.yml" - - "scripts/pythonize_snake.py" - -permissions: - contents: write - -jobs: - generate: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v7 - - - name: Generate the snake SVGs - uses: Platane/snk/svg-only@v3 - with: - github_user_name: ${{ github.repository_owner }} - outputs: | - dist/github-snake.svg?palette=github-light - dist/github-snake-dark.svg?palette=github-dark&color_dots=#1a1b26,#394b70,#3d59a1,#7aa2f7,#bb9af7 - - - name: Python colours, white eye, no progress bar - run: python3 scripts/pythonize_snake.py --no-bar dist/github-snake.svg dist/github-snake-dark.svg - - - name: Push the SVGs to the `output` branch - uses: crazy-max/ghaction-github-pages@v5 - with: - target_branch: output - build_dir: dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b908d4c..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -__pycache__/ -*.pyc -.DS_Store diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 30cf57e..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Ignored default folder with query files -/queries/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/SmartKeyerror.iml b/.idea/SmartKeyerror.iml deleted file mode 100644 index bc2cd87..0000000 --- a/.idea/SmartKeyerror.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/editor.xml b/.idea/editor.xml deleted file mode 100644 index 53a15f5..0000000 --- a/.idea/editor.xml +++ /dev/null @@ -1,250 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 724aaf1..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 8306744..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index c1f336d..347cb62 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,34 @@ - +# ้ข„่งˆๅˆ†ๆ”ฏ ยท ่ดก็Œฎๅ›พๅŠจ็”ปๅ€™้€‰ +> ๅช็”จๆฅ็œ‹ๆ•ˆๆžœ๏ผŒไธไผšๅ‡บ็Žฐๅœจไธป้กตไธŠใ€‚ๆฏไธช SVG ้ƒฝๆ˜ฏ็”จ SKeyerror ่‡ชๅทฑ็š„่ดก็Œฎๅ›พ็”Ÿๆˆ็š„ใ€‚ +## 1. ไฟ„็ฝ—ๆ–ฏๆ–นๅ— ยท leereilly/contribution-graph-art -[//]: # (waifu) +5 ๅ—ๆ–นๅ—ไปŽไธŠๅพ€ไธ‹่ฝ๏ผŒ8 ็ง’ไธ€่ฝฎ๏ผŒ้…่‰ฒ่‡ชๅŠจ่ทŸ้šๆ˜Žๆš—ๆจกๅผใ€‚ - - - python snake + + tetris -- ๐Ÿ˜ **PostgreSQL / Greenplum Kernel Engineer**, daily hacking on the Planner, ORCA, Executor, and Storage in WarehousePG -- ๐Ÿคฉ Love using **diagrams** to visualize the elegant designs of the computer world โ€” Psyduck โ€”โ€” [Psyduck](https://github.com/SKeyerror/Psyduck) -- ๐Ÿ‘ป **"Know not just the 'what', but the 'why'"** โ€” reading source code, firing up gdb / rr, and digging into the rabbit hole -- โœ๏ธ Writing deep dives into Postgres / Greenplum internals at [็Ÿฅๅ…ถ็„ถ, ็Ÿฅๅ…ถๆ‰€ไปฅ็„ถ](https://smartkeyerror.com/) +## 2. Python ่›‡ ยท Platane/snk + pythonize_snake.py +่“ๅคด็™ฝ็œผใ€ๅŽๅŠ่บซ้ป„๏ผ›ๅบ•้ƒจ่ฟ›ๅบฆๆกๅทฒๅŽปๆމ๏ผŒ็”ปๅธƒ้šไน‹่ฃ็Ÿฎใ€‚ + + + + + python snake + + +## 3. ๅฏน็…ง ยท ๅŽŸ็‰ˆ่ดชๅƒ่›‡๏ผˆTokyo Night ็ดซ๏ผ‰ + + + + + original snake + + +--- + +ๆทฑ่‰ฒ็‰ˆๅ•็‹ฌ็œ‹๏ผš[tetris](preview/tetris.svg) ยท [snake-python-dark](preview/snake-python-v3-dark.svg) ยท [snake-original-dark](preview/snake-original-dark.svg) diff --git a/assets/KuriyamaMirai.jpeg b/assets/KuriyamaMirai.jpeg deleted file mode 100644 index a915960..0000000 Binary files a/assets/KuriyamaMirai.jpeg and /dev/null differ diff --git a/preview/snake-original-dark.svg b/preview/snake-original-dark.svg new file mode 100644 index 0000000..1f5652a --- /dev/null +++ b/preview/snake-original-dark.svg @@ -0,0 +1 @@ +Generated with https://github.com/Platane/snk \ No newline at end of file diff --git a/preview/snake-original.svg b/preview/snake-original.svg new file mode 100644 index 0000000..e3caf39 --- /dev/null +++ b/preview/snake-original.svg @@ -0,0 +1 @@ +Generated with https://github.com/Platane/snk \ No newline at end of file diff --git a/preview/snake-python-v3-dark.svg b/preview/snake-python-v3-dark.svg new file mode 100644 index 0000000..ed4e6c7 --- /dev/null +++ b/preview/snake-python-v3-dark.svg @@ -0,0 +1 @@ +Generated with https://github.com/Platane/snk \ No newline at end of file diff --git a/preview/snake-python-v3.svg b/preview/snake-python-v3.svg new file mode 100644 index 0000000..2e84dea --- /dev/null +++ b/preview/snake-python-v3.svg @@ -0,0 +1 @@ +Generated with https://github.com/Platane/snk \ No newline at end of file diff --git a/preview/tetris.svg b/preview/tetris.svg new file mode 100644 index 0000000..71dfdfa --- /dev/null +++ b/preview/tetris.svg @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/pythonize_snake.py b/scripts/pythonize_snake.py deleted file mode 100755 index 87bb6ab..0000000 --- a/scripts/pythonize_snake.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 -"""Turn the Platane/snk snake into the Python-logo snake and drop the bar. - -Works on snk's svg-only output: every snake segment is a `` -driven by its own CSS keyframes, and the eaten-cells progress bar is a row of -`` under the grid. - - * front half of the body Python blue, back half Python yellow - * one white eye on the head (a circle sharing the head's classes, so it - inherits the head's animation) - * --no-bar: remove the progress bar and crop the empty space under the grid - -Usage: pythonize_snake.py [--no-bar] SVG... -Idempotent: a file that already carries the eye is left untouched. -""" -import argparse -import pathlib -import re - -BLUE, YELLOW, EYE = "#3776AB", "#FFD43B", "#FFFFFF" -EYE_SHAPE = '' -CELL = 16 # snk cell pitch - - -def pythonize(svg: str, no_bar: bool) -> str: - if ".eye{" in svg: - return svg - segs = sorted({int(n) for n in re.findall(r'class="s s(\d+)"', svg)}) - if not segs or "" not in svg: - raise SystemExit("not an snk svg-only snake file") - half = (len(segs) + 1) // 2 - css = (",".join(f".s{n}" for n in segs[:half]) + f"{{fill:{BLUE}}}" - + ",".join(f".s{n}" for n in segs[half:]) + f"{{fill:{YELLOW}}}.eye{{fill:{EYE}}}") - - if no_bar: - svg = re.sub(r']*/>', "", svg) - svg = re.sub(r"@keyframes u[0-9a-z]+\{.*?\}\}", "", svg) # keyframe blocks - svg = re.sub(r"\.u(?:\.u[0-9a-z]+|[0-9a-z]*)\{[^}]*\}", "", svg) # .u / .uN / .u.uN rules - vb = re.search(r'viewBox="(-?[0-9.]+) (-?[0-9.]+) ([0-9.]+) ([0-9.]+)"', svg) - x0, y0, w, _ = map(float, vb.groups()) - h = 7 * CELL + CELL - y0 # grid + one cell of air - svg = svg.replace(vb.group(0), f'viewBox="{x0:g} {y0:g} {w:g} {h:g}"', 1) - svg = re.sub(r'\bheight="[0-9.]+"(?=[^>]*xmlns)', f'height="{h:g}"', svg, count=1) - - svg = svg.replace("", css + "", 1) - head = re.search(r']*/>', svg) - return svg[: head.end()] + EYE_SHAPE + svg[head.end():] - - -def main(): - ap = argparse.ArgumentParser() - ap.add_argument("--no-bar", action="store_true") - ap.add_argument("svgs", nargs="+", type=pathlib.Path) - a = ap.parse_args() - for path in a.svgs: - path.write_text(pythonize(path.read_text(encoding="utf-8"), a.no_bar), encoding="utf-8") - print("pythonized", path, "(bar removed)" if a.no_bar else "") - - -if __name__ == "__main__": - main()