This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:20.04 | |
| RUN apt-get update && \ | |
| DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata && \ | |
| rm -rf /var/lib/apt/lists/* /var/cache/apt/* | |
| RUN ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \ | |
| dpkg-reconfigure --frontend noninteractive tzdata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM debian:bullseye | |
| # tzdata はすでに入っているので dpkg-reconfigure がそのまま使える | |
| RUN ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \ | |
| dpkg-reconfigure --frontend noninteractive tzdata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function func_name { | |
| case "${SHELL}" in | |
| */bash) | |
| # Bash | |
| echo ${FUNCNAME[2]} | |
| ;; | |
| */zsh) | |
| # Zsh | |
| echo ${funcstack[2]} | |
| ;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [tool.poetry] | |
| name = "mypackage" | |
| version = "0.1.0" | |
| description = "" | |
| authors = [] | |
| classifiers = [ | |
| "Private :: Do not Upload" | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:latest | |
| RUN apt-get update && \ | |
| apt-get install -y ffmpeg && \ | |
| rm -rf /var/lib/apt/lists/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE> | |
| <html> | |
| <head> | |
| <title>スタイルディクショナリ</title> | |
| </head> | |
| <body> | |
| <h1>スタイルディクショナリ</h1> | |
| <h2>共通</h2> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Stream output of `asyncio.create_subprocess_exec()`""" | |
| import asyncio | |
| import sys | |
| async def run(program: str, args: list[str]): | |
| """Capture output (stdout and stderr) while running external command.""" | |
| proc = await asyncio.create_subprocess_exec( | |
| program, *args, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Use Python Poetry cache on GitHub Actions workflow | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| PYTHON_VERSION: "3.11" | |
| POETRY_VERSION: "1.4.2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import shutil | |
| from pathlib import Path | |
| def delete_directory(path: str): | |
| """Delete a directory.""" | |
| for item in Path(path).iterdir(): | |
| if item.is_dir(): | |
| shutil.rmtree(item) | |
| else: |