Skip to content

Instantly share code, notes, and snippets.

View hololeo's full-sized avatar

UX Hololeo hololeo

View GitHub Profile
from promptsmith import EngineArguments, DataEngine, TopicTree, TopicTreeArguments
# Define the system prompt
system_prompt = (
"You are a knowledgeable dog expert. You provide detailed advice about dogs, "
"including training, health, breeds, and care. Always include specific examples "
"and practical advice."
)
# Create root prompts based on major dog topics
@ivanfioravanti
ivanfioravanti / gist:bcacc48ef68b02e9b7a4034161824287
Created January 25, 2024 00:01
Fine tuning dataset generation wiht Ollama python library
import json
import os
import ollama
def query_ollama(prompt, model='openhermes:7b-mistral-v2.5-q6_K', context=''):
response = ollama.generate(
model=model,
prompt=context + prompt)
return response['response'].strip()
@jart
jart / rename-pictures.sh
Created December 12, 2023 15:24
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <[email protected]>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
@fxprime
fxprime / ky_026_flame_sensor.ino
Created November 2, 2019 04:07
Flame sensor module KY-026
int led = 13; // define the LED pin
int digitalPin = 2; // KY-026 digital interface
int analogPin = A0; // KY-026 analog interface
int digitalVal; // digital readings
int analogVal; //analog readings
void setup()
{
pinMode(led, OUTPUT);
pinMode(digitalPin, INPUT);
@wsoyka
wsoyka / chromium_focus_tab_or_open_in_profile.scpt
Last active August 9, 2024 17:56
Applescript - Bring a specific chromium tab to front or open it in a given profile
###################################################
#
# Version: 2024-08
#
# This script will search all open Browser Windows for a specified Tab (by Title).
# At some point, this worked for Google Chrome and Brave Browser.
# Other chromium based browsers should work, but have not been tested.
#
# If no tab with the given title is found, it will open the specified URL in the
# specified Profile. If multiple tabs with the specified title exist, the first one
public class MainCamera : MonoBehaviour
{
public Transform[] Players;
public Vector3 Target;
public Vector3 BaseOffset;
public float Speed;
public float YZoomFactor;
public float ZZoomFactor;
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active June 26, 2025 12:26
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude ([email protected])
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
@demonixis
demonixis / UnitySystemInfo.cs
Created January 30, 2014 06:59
Retrieving system informations with Unity.
// System informations with Unity
// Doc: http://docs.unity3d.com/Documentation/ScriptReference/SystemInfo-graphicsDeviceName.html
Debug.Log ("Device model: " + SystemInfo.deviceModel);
Debug.Log ("Device name: " + SystemInfo.deviceName);
Debug.Log ("Device type: " + SystemInfo.deviceType);
Debug.Log ("Graphics device name: " + SystemInfo.graphicsDeviceName);
Debug.Log ("Graphics device vendor: " + SystemInfo.graphicsDeviceVendor);
Debug.Log ("Graphics device version: " + SystemInfo.graphicsDeviceVersion);