Skip to content

Instantly share code, notes, and snippets.

// Load environment variables
require('dotenv').config();
const { Client, GatewayIntentBits, Partials, PermissionsBitField, EmbedBuilder, AttachmentBuilder } = require('discord.js');
const fs = require('fs');
const path = require('path');
const csv = require('csv-parser');
const createCsvWriter = require('csv-writer').createObjectCsvWriter;
// Create a new Discord client
// Discord Speed Drawing Bot
const { Client, GatewayIntentBits, Partials, EmbedBuilder, AttachmentBuilder } = require('discord.js');
const fs = require('fs');
const path = require('path');
// Initialize client with necessary intents
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
@RH2
RH2 / uses file size to determine if it is an image with a trasform that needs to be included.
Created April 2, 2025 04:05
DICOM Houdini to VDB (you will need to remap values, result is not normalized 0-1 density)
import pydicom
import numpy as np
import os
import hou
def create_global_attrib(geo, name, value):
"""Safely create and set a global attribute"""
if geo.findGlobalAttrib(name) is None:
attrib = geo.addAttrib(hou.attribType.Global, name, value)
geo.setGlobalAttribValue(name, value)
@RH2
RH2 / HOT MESS CHARACTER CONTROL
Created March 30, 2025 07:29
Absolutely going to break all boundaries lol (UNITY)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CharacterMovement10 : MonoBehaviour
{
public Camera playerCamera;
public float mouseSensitivity = 2f;
private float verticalLookRotation;
@RH2
RH2 / LOSPEC.COM .HEX MATERIAL ADDON
Last active February 25, 2025 02:33
LOSPEC.COM .HEX MATERIAL ADDON
bl_info = {
"name": "Hex Color Materials from URL with Color Atlas",
"author": "RH",
"version": (1, 3),
"blender": (3, 0, 0),
"location": "View3D > Sidebar > Hex Materials Tab",
"description": "Create materials and color atlas from hex codes in a URL text file",
"category": "Material",
}
import * as THREE from 'three';
function createBrickWall({
rows = 5,
columns = 10,
brickWidth = 2,
brickHeight = 1,
brickDepth = 0.5,
mortar = 0.1,
color = 0x993333,
//best version yet...
function processElement(element, ALL_IDS) {
let stylesheet = '';
let svgString = '';
// Check if the element has children (e.g., <g> elements)
if (element.children.length > 0) {
// If it's a group, process each child
let groupContent = '';
//logic
//three components:
//front-door
float fd_width = chf("Front_Door_Width");
//wide-garage
float wg_width = chf("Wide_Garage_Width");
//narrow-garage
float ng_width = chf("Narrow_Garage_Width");
//spacing
PS C:\Program Files\Ultimaker Cura 5.2.1> .\CuraEngine.exe
Cura_SteamEngine version 5.2.1
Copyright (C) 2022 Ultimaker
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
C:\Users\Reference>vulkaninfo
==========
VULKANINFO
==========
Vulkan Instance Version: 1.3.201
Instance Extensions: count = 13
===============================