Skip to content

Instantly share code, notes, and snippets.

View jakkaj's full-sized avatar

Jordan Knight jakkaj

View GitHub Profile
@jakkaj
jakkaj / tot_wildcard.txt
Last active June 6, 2023 05:01
Tree of Thought plus wildcard expert
# Based on https://github.com/dave1010/tree-of-thought-prompting with wildcard added
# Whild card seems to help drive good answers especially in gpt4
Imagine three different experts are answering this question.
All experts will write down 1 step of their thinking, then share it with the group.
Then a wild card expert will come in and try to solve the problem by inverting it. Then all experts will go on to the next step until the problem is solved.
Finally the wildcard will check their answer again, in a wild card way.
If any expert realises they're wrong at any point then they backtrack.
Finally, an adjudicator will write the best answer.
@jakkaj
jakkaj / jorvis_discord.py
Created May 21, 2023 03:11
A simple Discord bot for LLM
# Import discord.py. Allows access to Discord's API.
import asyncio
import discord
# Import the os module.
import os
from concurrent.futures import ThreadPoolExecutor
@jakkaj
jakkaj / pip_version_pin.sh
Created April 18, 2023 05:26
Pins the versions of pip entries in the requirements.txt file. Unlike freeze, it only does the requirements file.
#!/bin/bash
# Check if requirements.txt exists
if [ ! -f "requirements.txt" ]; then
echo "Error: requirements.txt not found."
exit 1
fi
# Remove existing requirements2.txt if it exists
if [ -f "requirements2.txt" ]; then
@jakkaj
jakkaj / sgptmon.sh
Last active April 17, 2023 23:02
Monitor a file, feed it to sgpt when it changes and store the output in a file. Allows for quick prompt iteration and stuff...
#!/bin/bash
#https://gist.github.com/jakkaj/218887771f70466e844dcbe082cd2ff6
if [ -z "$OPENAI_API_KEY" ]; then
echo "The OPENAI_API_KEY environment variable is required and must not be empty."
exit 1
fi
if ! command -v inotifywait >/dev/null 2>&1; then
@jakkaj
jakkaj / capt_stereo_nvenc.py
Created May 19, 2022 02:42
Cap stereo image and re-stream to rtsp using nvenc
# MIT License
# Copyright (c) 2019-2022 JetsonHacks
# Using a CSI camera (such as the Raspberry Pi Version 2) connected to a
# NVIDIA Jetson Nano Developer Kit using OpenCV
# Drivers for the camera and OpenCV are included in the base image
import cv2
import time
import numpy as np
@jakkaj
jakkaj / ADKAR
Created May 26, 2020 00:14
ADKAR
ADKAR
@jakkaj
jakkaj / LICENSE
Created December 2, 2019 04:01 — forked from rkirsling/LICENSE
Directed Graph Editor
Copyright (c) 2013 Ross Kirsling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@jakkaj
jakkaj / wait.sh
Created May 22, 2019 21:30
Wait for bash script changes and act on them... in bash
#from https://github.com/rvoicilas/inotify-tools/wiki
apt-get install inotify-tools
inotifywait -r -m -e close_write ./spark.sh |
while read path _ file; do
echo "$path$file modified"
done
@jakkaj
jakkaj / .bashrc
Created May 15, 2018 01:22
Windows CD for WSL - changes to /mnt/x based paths from windows paths
alias wcd='. ~/wcd.sh'
@jakkaj
jakkaj / matrix_multiply.py
Created October 12, 2017 03:51
Multiply two matrices in Python (matrix transform)
import numpy as np
Y = [[0,1,2],
[3 ,4,5],
[6 ,7,8]]
X = [[0,-2,2],
[5,1,5],
[1,4,-1]]