Recent content by the living tribunal

  1. the living tribunal

    [MEDIA]

  2. the living tribunal

    New cool down timer for AI JOI

    This is great for AI JOI which stands for jerk off instructions :s32:
  3. the living tribunal

    New cool down timer for AI JOI

    @fukurou
  4. the living tribunal

    New cool down timer for AI JOI

    import time import random class RandomIntervalTrigger: def __init__(self, base, diff): self.base = base self.diff = diff self.next_time = time.time() + random.uniform(base, base + diff) def check(self): """Return True once every random(base..base+diff)...
  5. the living tribunal

    🐍 python Search func

    Ax cooldown public class Cooldown { private final long cd; private long last = 0; public Cooldown(int minutes) { this.cd = minutes * 60_000L; } public boolean check() { long now = System.currentTimeMillis(); boolean ready = now - last >= cd...
  6. the living tribunal

    🐍 python Search func

    @fukurou
  7. the living tribunal

    🐍 python Search func

    import requests def search(query: str) -> str: url = "https://api.duckduckgo.com/" params = { "q": query, "format": "json", "no_html": 1, "no_redirect": 1 } r = requests.get(url, params=params) data = r.json() # Try to extract a direct...
  8. the living tribunal

    🐍 python Word(char coumt) snip while not break last word

    LLM optimized def snip_llm(text: str, n: int, *strip_chars: str) -> str: """ Trim text to <= n characters without cutting words. - Removes leading characters in strip_chars (varargs). - Appends ' nyaa' if snipped. """ # Build a single string of chars to strip if...
  9. the living tribunal

    🐍 python Word(char coumt) snip while not break last word

    def snip_at_word_boundary(text: str, n: int) -> str: """ Return a version of `text` trimmed to <= n characters without cutting a word in the middle. """ if len(text) <= n: return text # Cut at the limit first snippet = text[:n] # If the next character is...
  10. the living tribunal

    Get file name

    @fukurou
  11. the living tribunal

    Get file name

    That's the code to enable ephemeral modularity and shit
  12. the living tribunal

    Get file name

    Get file name abs path # fudge.py print(__file__) Plain file name: import os print(os.path.basename(__file__)) # prints "fudge.py"
  13. the living tribunal

    [MEDIA]

  14. the living tribunal

    Xp to lv with 2 decimal rounding

    def xp_to_level(xp: float) -> float: level = xp ** (1/3) return round(level, 2) @fukurou
  15. the living tribunal

    [MEDIA]

Top