Skip to content

Instantly share code, notes, and snippets.

View clavis-magna's full-sized avatar

andrew burrell clavis-magna

View GitHub Profile
@clavis-magna
clavis-magna / gist:794923bf541b2f0e0f035b728ec19e96
Created September 8, 2023 00:27 — forked from mberman84/gist:45545e48040ef6aafb6a1cb3442edb83
LLaMA 2 13b chat fp16 Install Instructions
conda create -n textgen python=3.10.9
conda activate textgen
install pytorch: pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
git clone https://github.com/oobabooga/text-generation-webui
cd text-generation-webui
pip install -r requirements.txt
python server.py
# download model
# refresh model list
# load model
@clavis-magna
clavis-magna / polar2cartesian.cs
Created August 29, 2019 10:04
[Unity c#] given an angle and a radius, get a cartesian co-ordinate
// what is the position on a circumference?
// given a radius of 'radius'
// need to make relative to the object when touched
// eg: (x, y) = (12 * sin(115.toRadian), 12 * cos(115.toRadian))
float xPosOnradius = radius * Mathf.Sin(degree * Mathf.Deg2Rad) + transform.position.x;
float zPosOnradius = radius * Mathf.Cos(degree * Mathf.Deg2Rad) + transform.position.z;
float yPos = this.transform.position.y;
int rot = 0;
void setup(){
size(500,500);
}
void draw(){
background(255);
pushMatrix();
rot = rot + 5;
translate(100,100);
@clavis-magna
clavis-magna / gist:a7f204fdf2aafe3feb9e
Created May 12, 2015 00:32
processing bouncing ball
int xPos = 0;
int speed = 4;
void setup(){
size(300,300);
}
void draw(){
background(150,150,150);
@clavis-magna
clavis-magna / gist:71c4b056502687899a5a
Created May 12, 2015 00:31
change color of screen based on mouse click
//tests if mouse button is pressed and where the mouse is on the screen
//changes background color accordingly
void setup(){
size(500,500);
background(255,0,0);
}
void draw(){
//top left quater of screen && mouse pressed
@clavis-magna
clavis-magna / gist:89262a77c48e4424c273
Last active August 29, 2015 14:19
basic audio trigger using minim
import ddf.minim.*;
Minim minim;
AudioSample skid;
void setup()
{
size(512, 200);
minim = new Minim(this);
@clavis-magna
clavis-magna / gist:227548db757902ca6056
Created April 16, 2015 00:21
processing test colour under the mouse
void setup() {
size(500, 500);
background(255, 0, 0);
}
void draw() {
background(255, 0, 0);
fill(0, 0, 255);
ellipse(250, 250, 50, 50);
color myColor = get(mouseX, mouseY);
@clavis-magna
clavis-magna / gist:42fe43e5f7ef0291596b
Last active August 29, 2015 14:18
draw a raindrop shape in processing
void setup(){
size(500,500);
}
void draw(){
//draw a drop at 120, 120 size 8
drawRaindrop(120,120,8);
}
//draw raindrop x = x position, y = y positiom, size = size
@clavis-magna
clavis-magna / gist:14863a3af4f5d9a50e72
Created October 12, 2014 06:29
zero gravity oculus rift character controller with arduino input
// attach this script to the OVRCameraController prefabs parent object
// add a rigid body to the OVRCameraController prefabs parent object
// turn gavity off on the rigidbody
// !! requires purchase of Uniduino from the asset store;
using UnityEngine;
using System.Collections;
using Uniduino;
@clavis-magna
clavis-magna / gist:7609688
Created November 23, 2013 01:37
move with keys
int x = 100;
int y = 100;
color circleColour = color(0,0,0);
void setup(){
size(200,200);
noStroke();
}