Skip to content

Instantly share code, notes, and snippets.

View enven-omiomi's full-sized avatar
👨‍👨‍👧‍👦
Happy?

Enven enven-omiomi

👨‍👨‍👧‍👦
Happy?
View GitHub Profile
@enven-omiomi
enven-omiomi / descriptor.py
Created August 23, 2023 13:56
python note
from dataclasses import Field, dataclass, field, fields
from typing_extensions import dataclass_transform
class FieldDescriptor:
def __init__(self, field: Field):
self.field = field
def __get__(self, instance, owner):
@enven-omiomi
enven-omiomi / README.md
Last active May 9, 2023 05:59
A Python script that replaces the placeholders in the YAML file with the contents of the other file

This Python script, replace_function_code.py, is designed to replace a placeholder in a YAML file with the content of a Python file.

The script requires three positional arguments:

  1. yaml_file: This is the YAML file to be processed.
  2. python_file: The Python file whose content will be inserted into the YAML file.
  3. placeholder: The string in the YAML file to be replaced.

The script also accepts two optional arguments:

  1. -o or --output: This allows you to specify the name of the output file. If not provided, the default output file name is "output.yaml".
  2. -w or --overwrite: If this option is set, the original YAML file will be overwritten with the processed content.
@enven-omiomi
enven-omiomi / data.json
Created August 23, 2020 16:28
MostStartPythonProject_rootFiles
[
{"prj_name": "system-design-primer", "repo_name": "donnemartin/system-design-primer", "file_names": [".gitattributes", ".gitignore", "CONTRIBUTING.md", "LICENSE.txt", "README-ja.md", "README-zh-Hans.md", "README-zh-TW.md", "README.md", "TRANSLATIONS.md", "epub-metadata.yaml", "generate-epub.sh"]},
{"prj_name": "poetry", "repo_name": "python-poetry/poetry", "file_names": [".cirrus.yml", ".coveragerc", ".flake8", ".gitignore", ".pre-commit-config.yaml", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", "Makefile", "README.md", "get-poetry.py", "make-nix-release.sh", "mypy.ini", "poetry.lock", "pyproject.toml", "sonnet", "tox.ini"]},
{"prj_name": "rich", "repo_name": "willmcgugan/rich", "file_names": [".coveragerc", ".gitignore", ".readthedocs.yml", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "CONTRIBUTORS.md", "LICENSE", "Makefile", "README.cn.md", "README.md", "make.bat", "poetry.lock", "pull_request_template.md", "pyproject.toml", "requirements-dev.txt", "setup.py"]},
{"prj_na