Skip to content

Instantly share code, notes, and snippets.

import llama_cpp
import re
import json
# Model configuration
# tested with mistral, llama2, llama3, and phi3
model_path = "/path/to/model"
base_llm = llama_cpp.Llama(model_path, seed=42, n_gpu_layers=-1, n_ctx=4096, verbose=False, temperature=0.0)
@leymannx
leymannx / iterm2-oh-my-fish.md
Last active May 5, 2024 13:53
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra
git clone https://github.com/OpenDevin/OpenDevin.git
cd OpenDevin
conda create -n od python=3.10
conda activate od
docker ps
(optional) install docker if not already installed
docker pull ghcr.io/opendevin/sandbox
export OPENAI_API_KEY={your key}
(optional I had to install rust) curl --proto '=https' --tlsv1.2 -sSf [https://sh.rustup.rs](https://sh.rustup.rs/) | sh
(optional) restart terminal
@adammyhre
adammyhre / Observable.cs
Last active May 5, 2024 13:52
Generic Observable with ValueChanged Action
using System;
using System.Collections.Generic;
[Serializable]
public class Observable<T> {
private T value;
public event Action<T> ValueChanged;
public T Value {
get => value;
@adammyhre
adammyhre / AbilitySystem.cs
Last active May 5, 2024 13:51
MVC Ability System
[CreateAssetMenu(fileName = "AbilityData", menuName = "ScriptableObjects/AbilityData", order = 1)]
public class AbilityData : ScriptableObject {
public AnimationClip animationClip;
public int animationHash;
public float duration;
public Sprite icon;
public string fullName;
void OnValidate() {
@adammyhre
adammyhre / ImprovedTimers.cs
Last active May 5, 2024 13:51
Improved Timers for Unity
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
namespace ImprovedTimers {
public static class TimerManager {
static readonly List<Timer> timers = new();
@jam1garner
jam1garner / switch-gdb-cheatsheet.md
Last active May 5, 2024 13:51
GDB for Switch Modding Cheatsheet/Tutorial

This is a mini-tutorial of sorts for getting started with gdb on the Switch, with the target audience being people who want to mod and/or reverse games, with no prerequisite knowledge of gdb. The goal will be to walk you through some of the basic workflows needed to use a debugger on the Switch, while being brief enough for skimming for when you forget things.

If some part is unclear, your OS doesn't have install instructions, or you feel part of your workflow should be added here, feel free to comment any additions.

(If you only need a quick reference Jump to the Appendix)

Installing GDB

First off you'll need a version of GDB compatible with aarch64. This can be obtained via either a distribution of

@adammyhre
adammyhre / PriorityQueue.cs
Created April 29, 2024 02:40
Double Key Priority Queue for Unity C#
using System;
using System.Collections.Generic;
public class PriorityQueue<T> {
class KeyNodeComparer : IComparer<(Key, T)> {
public int Compare((Key, T) x, (Key, T) y) {
return x.Item1 < y.Item1 ? -1 : x.Item1 > y.Item1 ? 1 : 0;
}
}