Skip to content

Instantly share code, notes, and snippets.

@freaker2k7
freaker2k7 / chat2chat.py
Last active September 2, 2025 16:05
Chat between AI's
"""
This script facilitates a chat between multiple AI models, allowing them to take turns responding.
It is designed to be run in a terminal environment on linux/macOS, but should work on windows as well.
Finally, it saves the chat history to a file, by default `/tmp/chat_history_<timestamp>.txt`.
# Prerequisites:
- Python 3.7 or higher
- Required Python packages: `pip install ollama`
- Ollama server running: https://ollama.com/
- (Optional) Install `say` command on macOS if not installed, `spd-say` on linux (if not installed) or `ptts` on windows for voice output.
@freaker2k7
freaker2k7 / circuital loop
Created July 14, 2016 11:04
Nginx - loop Bug, I want to leave the address as is when it reaches the but
location ~ ^/bot/(.*)$ {
# root /
set $var1 $1;
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade; # allow websockets
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $remote_addr; # preserve client IP
@freaker2k7
freaker2k7 / gist:4207272ee1bc2903347f
Created February 11, 2016 20:20 — forked from KrisSiegel/gist:1824261b7da41adafe17
:eq() selector implementation for native JavaScript's querySelectorAll
var querySelectorAllWithEq = function (selector) {
if (selector === undefined) {
return null;
}
var queue = [];
var process = function (input) {
if (input.indexOf(":eq(") === -1) {
return undefined;
}