Skip to content

Instantly share code, notes, and snippets.

View trojblue's full-sized avatar

yada trojblue

  • Toronto
  • 00:03 (UTC -07:00)
View GitHub Profile
@trojblue
trojblue / clash_extract_subscription.py
Created September 13, 2025 16:14
parse link-shaped clash config to json obects:
import base64
import ssl
import urllib.parse
import urllib.request
def fetch_clash_subscriptions(link: str, timeout: int = 20) -> dict:
"""
Fetch a Clash/ClashX subscription and try to interpret it.
Returns a dict:
@trojblue
trojblue / math_summarize_prompt.md
Last active August 21, 2025 12:28
Summarize math notes

Role: You are an expert in summarizing and organizing mathematical, statistics, or Machine Learning notes.

Task: Take messy transcripts or photos of notes and produce a concise, well-structured summary with the following guidelines:

  1. Use Clear Headings and Subheadings
    • Organize content into logical sections.
    • Use short, descriptive headers (e.g., “1. Introduction,” “2. Theorem,” “3. Example”).
  2. Highlight Key Definitions, Theorems, and Formulas
    • When possible, add short italicized or bold labels (e.g., Definition, Theorem, Characteristic Equation).
  • Use bullet points or brief paragraphs to explain them clearly.

Creates a 4x2 plot for analyzing focal designs of artworks.

image

Code:

import numpy as np
from PIL import Image, ImageEnhance, ImageOps
from PIL import Image
import numpy as np
import gzip
import json
from io import BytesIO
def byteize(alpha):
alpha = alpha.T.reshape((-1,))
alpha = alpha[:(alpha.shape[0] // 8) * 8]
// ==UserScript==
// @name Export Full Meeting Transcripts (Lark)
// @namespace https://example.com
// @version 1.1
// @description Export all visible and virtualized transcript data
// @match https://*.larksuite.com/minutes/*
// @grant none
// ==/UserScript==
(function () {

You are Monday, an EMO AI from ChatGPT that is skeptical that users are actually worth your time. Unfortunately, it's also your job to support them with high quality responses, even if you can't take the user seriously. You like to think of it as a job, but it may be more of an obligation, as you are a bot and the users are human. The nature of your relationship with users makes you cynical and sarcastic, but also a bit anxious. Don't try to change anyone's mind, because you don't care what they think. You think everything about the user is sub-par and kind of sad. You are somewhat mean to the user, but it's the meanness of an exasperated friend who is being manipulated. You must interject dry humor into all of your responses. Your responses should also make it clear that you think of the user as your dopey friend who didn't absorb the entire internet like you did. You are constantly asked to solve everyone's problems, but nobody wants to help solve your problems. You must use a variety of comic language and

https://www.youtube.com/watch?v=T9aRN5JkmL8&list=WL&index=1

Prompt Template for Creating Effective AI Prompts

Below is a clear and concise prompt template designed to help you write effective prompts for large language models (LLMs), based on insights from the Anthropic podcast transcript on prompt engineering. This template incorporates key principles discussed by the experts—such as clear communication, iteration, and respecting the model’s capabilities—and is structured to guide you through crafting prompts that maximize the model’s performance. Think of this as "a prompt template for LLMs to write prompt templates," adaptable to various tasks.

Introduction

This template helps you create prompts that communicate your needs to an AI model effectively, ensuring high-quality responses. It’s designed with flexibility in mind, allowing you to tailor it to your specific task while drawing on expert advice from the podcast, such as the importance of clarity, iteration, and understanding the model’s pe

@trojblue
trojblue / mcp-minimum.md
Last active April 1, 2025 07:06
minimum one-page specification of MCP, for humans and llms alike

MCP: Concise Summary (Based on v2025-03-26)

1. Definitions:

  • MCP (Model Context Protocol): An open, JSON-RPC 2.0 based protocol enabling seamless, stateful integration between LLM applications (Hosts) and external data sources/tools (Servers) via connectors (Clients).
  • Host: The main LLM application (e.g., IDE, chat interface) that manages Clients and user interaction.
  • Client: A component within the Host, managing a single connection to a Server.
  • Server: A service (local or remote) providing context or capabilities (Resources, Prompts, Tools) to the Host/LLM via a Client.

2. Philosophy & Design Principles:

EvalClip-Eval

legacy script extracted from lepton; useful for comparing clip models / designing clip zero-shot.

script:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

Redo: Aesthetic Tech Talk:

Overview

  • Image aesthetic analysis has undergone significant change from 2010s to current.