Skip to content

Instantly share code, notes, and snippets.

View hockenmaier's full-sized avatar

Brian Hockenmaier hockenmaier

View GitHub Profile
@hockenmaier
hockenmaier / codex-achievements-prompt.md
Last active August 3, 2025 21:52
Codex Prompt for The Ball Machine Achievements Feature

This prompt is what OpenAI's Codex used to draft the first version of the achievements feature in The Ball Machine, which you can read about here:

https://hockenworks.com/this-website/#ball-machine---the-game

This prompt was voice-transcribed directly into Codex, so you'll notice some transcription issues. Codex did fine with those, and completed the described feature here after 2 additional chats. Here is the location of the notes folder refernced in this prompt; with the ball machine context being the most relevant instruction file:

https://github.com/hockenmaier/hugohome/tree/master/notes

The "site-description.md" and "ball-machine-context.md" are the most relevant notes there.

@hockenmaier
hockenmaier / testresnet.py
Last active August 6, 2023 23:04
HuggingFace Test Script - some python code to run locally you can use to test Huggingface's free inference APIs
import requests
import json
API_URL = "https://api-inference.huggingface.co/models/facebook/detr-resnet-50"
headers = {"Authorization": f"Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}
def query(filename):
try:
with open(filename, "rb") as f:
data = f.read()
@hockenmaier
hockenmaier / chatGPTSender.py
Created March 25, 2023 17:17
A python script to bring up chatGPT and send a message
#You can create a simple Python script using the selenium library to interact with the website. Make sure you have the selenium library installed and the appropriate web driver for your browser (e.g., ChromeDriver for Chrome).
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
@hockenmaier
hockenmaier / ApplicationDefinitionSet.cs
Created March 16, 2023 15:45
Unity Multi-App Switch
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EasyButtons;
using UnityEngine.SceneManagement;
using UnityEditor;
using System.Linq;
[System.Serializable]
public class ApplicationDefinition
@hockenmaier
hockenmaier / TweenPhysicsSim.cs
Last active October 21, 2022 19:33
Tween-Simulated Physics Class. Attaching to an object gives you methods to start and stop tracking actual world velocity, plus some sample methods to do a simulated non-physics throw, etc
public class TweenPhysicsSim : MonoBehaviour
{
[Header("Return and track velocity settings")]
public float throwLaunchFactor = 15f;
public bool bounceAndHoverOnReturn = true;
[Header("Hover Only Settings")]
public bool startHovering = false;
public float HoverBounceHeightRatio = 1.02f;
[HideInInspector]
@hockenmaier
hockenmaier / SceneShot.cs
Last active August 18, 2022 02:13
A simple utility to take high-res screenshots of the Unity scene view
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EasyButtons;
//To set up:
//Install Unity easy buttons (https://github.com/madsbangh/EasyButtons) This can simply be done by using the package manager, clicking the "+", and pointing to this github link (https://github.com/madsbangh/EasyButtons.git#upm):
//Attach this script and a Camera component to a loose gameobject in your scene named something like "SceneScreeenShotTaker"
//To take a screenshot:
@hockenmaier
hockenmaier / RidablePlus.cs
Last active April 21, 2022 01:44
This class is used to make a moving platform "ridable". This means the player's ship (represented by Globals.playerShip here) is parented to the platform when it collides and unparented when it leaves. It also imparts realistic velocity to the ship's rigidbody when it leaves and handles network updating of the ship's riding status. All netcode i…
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
[RequireComponent(typeof(PhotonView))]
public class RidablePlus : MonoBehaviour
{
private bool isBeingRidden = false;
private Vector3 ridableRelativeShipPosition;
@hockenmaier
hockenmaier / examplePhotonNetworkJoin.cs
Last active September 18, 2021 19:31
This is a basic script that will connect to the Photon network and create or join a room called "Room 1". Any client running this script will connect to the same room.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
public class NetworkManager : MonoBehaviourPunCallbacks
{
void Start()
{