Skip to content

Instantly share code, notes, and snippets.

View drusepth's full-sized avatar
💭
hacking away on notebook.ai

Andrew Brown drusepth

💭
hacking away on notebook.ai
View GitHub Profile
View sage.rb
require 'discordrb'
require 'dotenv'
require 'openai' # ruby-openai gem, not openai gem
require 'optparse'
require 'yaml'
require 'httparty'
def parse_options
options = {}
OptionParser.new do |opts|
View cutscene.cs
void Start()
{
StartCoroutine(Script());
}
private void Update()
{
if (waitingForClick && (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space)))
waitingForClick = false;
}
View SerializableDictionaryDrawer.cs
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(SerializableDictionary<,>))]
public class SerializableDictionaryDrawer : PropertyDrawer
{
private const float Padding = 2f;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
View export-all-tables-to-sql.rb
require 'csv'
export_folder = "./export"
FileUtils.mkdir_p(export_folder) unless File.exists?(export_folder)
exported_tables = []
skipped_tables = []
puts "Starting CSV export"
ActiveRecord::Base.connection.tables.each do |table_name|
file = "#{export_folder}/#{table_name}.csv"
View hoverboard_controller.cs
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class HoverboardController : MonoBehaviour
{
public float multiplier; // How much force to exert on the ground to keep afloat
// This would be super cool to lerp off hoverboard battery level
// Potential game loop: find batteries?
View stack.cs
public class CardColumnManager : MonoBehaviour
{
public Stack<GameObject> card_stack;
void Start()
{
card_stack = new Stack<GameObject>();
}
public void AddCard(GameObject card)
View novelgens-promptgen-mar-24.py
import random
import re
#@title Prompt Settings
adjective = [
'Fierce', 'Scary', 'Interesting', 'Novel', 'Furry', 'Long-haired', 'Short-haired',
'Electric', 'Plasma', 'Humanoid', 'Insectoid', 'Alien', 'Tundra', 'Siberian', 'Ancient',
'Gigantic', 'Tiny', 'Small', 'Large', 'Oversized', 'Wild', 'Shadowy', 'Evil', 'Angelic',
'Good', 'Holy', 'Crystalline', 'Impressive', 'Cute', 'Kawaii', 'Celestial', 'Chibi',
'Anime', 'Manga', 'Live-action', 'Japanese', 'Western', 'Eastern', 'Zombified', 'Immortal',
View old-prompts-gen.py
import random
import re
#@title Prompt Settings
adjective = [
'Fierce', 'Scary', 'Interesting', 'Novel', 'Furry', 'Long-haired', 'Short-haired',
'Electric', 'Plasma', 'Humanoid', 'Insectoid', 'Alien', 'Tundra', 'Siberian', 'Ancient',
'Gigantic', 'Tiny', 'Small', 'Large', 'Oversized', 'Wild'
]
View tk.rb
#!/usr/bin/ruby
require 'cinch'
require 'net/http'
require 'uri'
bot = Cinch::Bot.new do
configure do |c|
c.nick = "TK"
c.realname = "TK"
View tiamat.rb
require 'ruby2d'
BUILD = :DEVELOPMENT
set title: 'Tiamat',
background: 'blue',
width: 640, viewport_width: 640,
height: 480, viewport_height: 480,
resizable: false,
borderless: BUILD == :PRODUCTION,
fullscreen: BUILD == :PRODUCTION,