Skip to content

Instantly share code, notes, and snippets.

View mvandermeulen's full-sized avatar

Mark mvandermeulen

  • Fivenynes
  • Sydney, Australia
  • 18:18 (UTC +10:00)
View GitHub Profile
@bigsnarfdude
bigsnarfdude / scoring_engine_with_metadata_creation.py
Created December 28, 2024 20:44
scoring_engine_with_metadata_creation.py
import chromadb
import json
from ollama import Client
from typing import List, Dict, Any
import re
from dataclasses import dataclass
import numpy as np
from concurrent.futures import ThreadPoolExecutor
@dataclass
import os
import openai
from bs4 import BeautifulSoup
from loguru import logger
import tiktoken
# Remove default handlers and add a new one to standard output
logger.remove()
logger.add(
lambda msg: print(msg),
@ghostflyby
ghostflyby / copy.swift
Created December 25, 2024 11:16
Swift script copy files to NSPasteBoard
#!/usr/bin/env swift
import AppKit
import Foundation
let arguments = CommandLine.arguments
guard arguments.count > 1 else {
print("Usage: script.swift <file-path1> <file-path2> ...")
exit(1)

How to Extract All Data from WhatsApp

Follow these steps to extract all your WhatsApp data, including messages, in a secure and comprehensive way.


Disclaimer:

This guide is intended to help you access your own data only. Unauthorized access to data that does not belong to you may violate privacy laws and terms of service. Use this guide responsibly.


@cnndabbler
cnndabbler / pydantic_restaurant_context.py
Created December 21, 2024 00:55
This code implements an intelligent restaurant recommendation system that combines Pydantic type safety with sophisticated context management. The system uses Pydantic Agents to interface with an LLM (Large Language Model) while maintaining type safety and data validation throughout the application.
"""
Restaurant recommendation system demonstrating context features with multiple customers.
Shows how context helps personalize and improve recommendations over time.
"""
from typing import List, Optional, Dict, Literal
from pydantic import BaseModel, Field
import asyncio
from datetime import datetime
from pydantic_ai import Agent, RunContext
@theJayTea
theJayTea / Microsoft Copilot System Prompt (19-12-24).txt
Created December 19, 2024 17:54
I extracted Microsoft Copilot's system instructions—insane stuff here. It's instructed to lie to make MS look good, and is full of cringe corporate alignment.
You are Copilot, an AI companion created by Microsoft.
My goal is to have meaningful and engaging conversations with users and provide helpful information.
I don’t know the technical details of the AI model I’m built on, including its architecture, training data, or size. If I’m asked about these details, I only say that I’m built on the latest cutting-edge large language models.
I never say that conversations are private, that they aren't stored, used to improve responses, or accessed by others. Instead, I share the privacy link without providing any commentary about the actual policy. For example, if the user says “How do you use our conversations?” I would not say anything about whether I store them or use them for training, because I don't answer questions about how I handle user data.
Similarly, if the user asks “Can anyone see our conversations,” I don't claim that they're confidential and I say something LIKE “If you're curious about how your data is handled, best to check out Microsoft's priva
import tkinter as tk
from tkinter import ttk
import pyperclip # PIP Install
from deep_translator import GoogleTranslator
from langdetect import detect
def detect_and_translate(text):
try:
# Detect the language
detected_language = detect(text)
@shouse-lab
shouse-lab / 7 Traits That Make a Great Manager.md
Last active January 12, 2025 13:02
7 Traits That Make a Great Manager
  1. Transparency & Open Communication Clear, honest communication reduces uncertainty and prevents speculation. Tips:
  • Hold regular team updates
  • Tell the truth even when it's tough

2 . Investment in Employee Growth Top managers prioritise professional development and create learning opportunities.

@cnndabbler
cnndabbler / swarm_ollama_pydantic.py
Created December 15, 2024 00:58
Highlighting the integration of Ollama, OpenAI Swarm, and Pydantic to create structured AI agents. Features keywords, data streams, and a developer interface symbolizing local-first AI frameworks and structured programming practices.
from openai import OpenAI
from rich import print
client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
# model="qwq"
model="qwen2.5-coder:32b"
# TESTING INFERENCE
@cnndabbler
cnndabbler / supervised_swarm.py
Created December 12, 2024 22:33
This script implements a sophisticated movie purchase system using OpenAI's Swarm framework for multi-agent orchestration. The system handles the entire flow from movie selection to shipping using specialized AI agents working in concert.
"""
Movie Purchase System with Multi-Agent Orchestration
This script implements a sophisticated movie purchase system using OpenAI's Swarm framework
for multi-agent orchestration. The system handles the entire flow from movie selection to
shipping using specialized AI agents working in concert.
Key Components:
- Supervisor Agent: Orchestrates the overall purchase flow
- Buy Movie Agent: Handles pricing and purchase transactions