Skip to content

Instantly share code, notes, and snippets.

View CharlieHess's full-sized avatar
🗑️

Charlie Hess CharlieHess

🗑️
View GitHub Profile
@CharlieHess
CharlieHess / mojs__core.d.ts
Created October 19, 2025 22:56
mojs types
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
/* eslint-disable @typescript-eslint/no-empty-object-type */
declare module "@mojs/core" {
const mojs: {
Shape: typeof mojsNamespace.Shape;
addShape: typeof mojsNamespace.addShape;
Module: typeof mojsNamespace.Module;
CustomShape: typeof mojsNamespace.CustomShape;
Tweenable: typeof mojsNamespace.Tweenable;
@CharlieHess
CharlieHess / CircularTextMeshPro.cs
Last active August 3, 2025 12:46
Improved CircularTextMeshPro using OnPreRenderText
using UnityEngine;
using TMPro;
using Sirenix.OdinInspector;
/// <summary>
/// An extension of TextMeshPro that causes the text to be displayed in a
/// circular arc.
///
/// Adapted from https://github.com/TonyViT/CurvedTextMeshPro and improved.
/// TonyViT's version has some unnecessary properties and doesn't use the
@CharlieHess
CharlieHess / Item.cs
Created June 6, 2023 17:21
Flexible serialization using SOs and DTOs
[Serializable]
[JsonObject(MemberSerialization.OptIn)]
public class Item {
[JsonProperty]
public string Id;
// ... other stuff
/// <summary>
/// This only needs to be implemented for *mutable* serialized properties.
@CharlieHess
CharlieHess / ParticleRotation.shader
Created April 5, 2023 14:26
Rotating particles using particleVelocity
Shader "Custom/ParticleRotation" {
Properties {
_MainTex ("Particle Texture", 2D) = "white" {}
_TintColor ("Tint Color", Color) = (1, 1, 1, 1)
}
SubShader {
Tags {"Queue"="Transparent" "RenderType"="Transparent"}
LOD 100
@CharlieHess
CharlieHess / IsoAlignedBoxCollider2D.cs
Created October 30, 2022 01:26
Generates an isometric aligned polygon collider in a box shape
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
public enum IsoAlignmentOption {
NorthSouth,
EastWest,
NorthEastSouthWest,
NorthWestSouthEast
}
@CharlieHess
CharlieHess / IsoSpriteSorting.cs
Created August 30, 2022 01:07
IsoSpriteSorting Improved
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Zenject;
public enum IsoSortType {
Point,
Line
}
@CharlieHess
CharlieHess / use-shake-controller.ts
Created June 23, 2021 20:08
useShakeController—apply a shake effect to any Object3D
import { MutableRefObject, useEffect, useMemo, useRef, useState } from 'react';
import { Clock, Euler, MathUtils, Object3D, Vector3 } from 'three';
import { SimplexNoise } from 'three-stdlib';
import { ShakeController } from '@react-three/drei';
import { useFrame } from '@react-three/fiber';
export interface ShakeControllerParam {
max: number;
frequency: number;
{
"environment": "production",
"extra": {
"crashed_process": "browser"
},
"release": "[email protected]",
"user": {
"ip_address": "{{auto}}"
},
"tags": {
@CharlieHess
CharlieHess / main.js
Last active October 14, 2020 20:17
paintWhenInitiallyHidden
const {app, BrowserWindow} = require('electron')
let mainWindow
function createWindow () {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
show: false,
paintWhenInitiallyHidden: false,
@CharlieHess
CharlieHess / index.html
Last active September 21, 2020 21:13
Missing separator at end of items list
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->