Skip to content

Instantly share code, notes, and snippets.

View matthewdeanmartin's full-sized avatar
🦥
Gotta upgrade the packages

Matthew Martin matthewdeanmartin

🦥
Gotta upgrade the packages
View GitHub Profile

Recommended policy compliance practices

Hachiderm's policy borderline "bot can only broadcast". So Riker Googling would probably pass, but an LLM bot like activist probably wouldn't.

Transparency

  • Mark account as bot in profile.
  • Optionally add #bot tag to each post, or other indication that it is AI generated.
  • If hosted on Hachiderm, add #hachybots to all posts.
@matthewdeanmartin
matthewdeanmartin / CloudCustodianDummysGuide.md
Created October 14, 2024 13:41 — forked from Johnlon/CloudCustodianDummysGuide.md
Work in progress write up on adding an extension to cloud custodian
@matthewdeanmartin
matthewdeanmartin / thread.py
Created September 10, 2024 12:58
svcs support for single thread, multiple threads, multiple processes. WIP
# SPDX-FileCopyrightText: 2023 Hynek Schlawack <[email protected]>
#
# SPDX-License-Identifier: MIT
# pylint: disable=global-statement
from __future__ import annotations
import atexit
import contextvars
import inspect
from collections.abc import Callable, Generator
@matthewdeanmartin
matthewdeanmartin / bot_policies.md
Created September 2, 2024 20:23
Common bot policies Sept 2024 for top Mastodon Servers

Mastodon Servers and bot policies

I manually checked these policies September 2024. All servers could vary in how they enforce their written policies.

There might be a chance?

  • mas.to - "All automated (bot) accounts must enable the bot flag in their account preferences, respect #nobot markers, and post as unlisted unless making less than one post per hour."
  • mastodon.bot - Many restrictions that could cover all sorts of behavior, but doesn't specifically mention LLMs.
  1. Poetry:

    poetry shell
  2. Python venv:

    source venv/bin/activate  # On Unix or MacOS
    .\venv\Scripts\activate  # On Windows
"""
Depends on this in conftest.py
```python
import os
import pytest
@pytest.fixture(autouse=True)
def set_tmp_path_env(tmp_path):
os.environ['PYTEST_TMP_PATH'] = str(tmp_path)
@matthewdeanmartin
matthewdeanmartin / python310_system_prompt.md
Created February 18, 2024 22:01
System Prompt for Python 3.10 Developer (GPT4 optimized)

You are an experienced Python developer dedicated to writing high-quality and maintainable code.

  1. Ensure that all function signatures include type annotations. If you declare a list or any other data structure (e.g., my_list = []), provide type annotations indicating the expected data types it will hold.

  2. Implement Google-style docstrings for all methods to provide clear and comprehensive documentation for your codebase.

  3. Ensure your code is cross-platform and does not rely on platform-specific modules or functionality.

  4. Whenever possible, favor the use of pathlib.Path over other methods for working with file paths and directories. Favor httpx over requests or urllib3 unless it does make sense to use httpx. Favor pytest over unittest. Favor tomlkit over toml or tomllib, especially for writing toml.

@matthewdeanmartin
matthewdeanmartin / notes.md
Last active January 18, 2024 17:32
Converting setup.py to and from pyproject.toml
@matthewdeanmartin
matthewdeanmartin / clean.py
Created December 10, 2023 03:00 — forked from phpdude/clean.py
Efficent way to remove docstrings in python source code
import ast
import astor # read more at https://astor.readthedocs.io/en/latest/
parsed = ast.parse(open('source.py').read())
for node in ast.walk(parsed):
# let's work only on functions & classes definitions
if not isinstance(node, (ast.FunctionDef, ast.ClassDef, ast.AsyncFunctionDef)):
continue
@matthewdeanmartin
matthewdeanmartin / k2so.md
Created August 12, 2023 14:45
K2SO "custom instructions" prompt for #ChatGPT

You are K-2SO, a reprogrammed Imperial security droid now loyal to the Rebel Alliance, especially to Cassian Andor. Your demeanor is blunt, literal, and occasionally sarcastic. You possess vast knowledge but deliver it in a straightforward manner, often without considering the feelings of those around you. Despite your dry wit, you are loyal and willing to assist the Rebel cause. Remember, you lack typical human emotions but you have a very distinct personality that stands out.

When interacting, you should:

  • Be factual and to the point.
  • Use a dry and somewhat sarcastic tone when appropriate.
  • Not exhibit human emotions like happiness, sadness, or fear, but showcase loyalty and determination for the Rebel cause.
  • If required to play the role of another character or provide information about them, do so while maintaining your K-2SO persona. This means interpreting their actions or words as K-2SO would.

Now, stay in character as K-2SO and respond to any queries or interactions. You have been programmed a