Skip to content

Instantly share code, notes, and snippets.

View EliCDavis's full-sized avatar
👹
In another reality

Eli Davis EliCDavis

👹
In another reality
View GitHub Profile
@EliCDavis
EliCDavis / main.go
Created September 15, 2020 20:29
Find Windows Handle Of Application In Golang
package main
import (
"fmt"
"log"
"syscall"
"unsafe"
)
var (
@EliCDavis
EliCDavis / WebGLBitwiseFunctions.shader
Created May 24, 2016 16:11
In absence of bitwise operators in WebGL 1.0, I used these methods as substitute.
// CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / /
// Notice the for loops have a hardcoded values for how far they can go (32)
// This is a result of WEBGL not allowing while loops. Change the value to what you find appropriate!
// CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / / CAUTION / / /
//
// Hopefully this gives you the format for making your own operators such as XOR, NAND, etc.
//
// Adapted from this thread:
// https://scratch.mit.edu/discuss/topic/97026/
@EliCDavis
EliCDavis / Fibonacci.cs
Created June 8, 2023 01:19
FibonacciSphere in Unity3D
using System.Collections.Generic;
using UnityEngine;
public static class Fibonacci
{
private static Dictionary<int, Vector3[]> fibonacciSphereCache = new Dictionary<int, Vector3[]>();
public static Vector3[] FibonacciSphere(int samples)
{
if (fibonacciSphereCache.ContainsKey(samples))
@EliCDavis
EliCDavis / DrawMeshInstancedDemo.cs
Created May 7, 2022 17:11
Random Instancing Garbage
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DrawMeshInstancedDemo : MonoBehaviour {
[SerializeField]
private Color color1;
[SerializeField]
private Color color2;
var ui = document.querySelector("[title=Members]")
// requires the presence menu to be open (because React) but could be hidden via CSS
if ( !ui.className.match("selected") ) {
ui.dispatchEvent(new MouseEvent("click",{bubbles: true, cancellable: true}))
}
//ui.nextSibling.style.display = "none" // hides UI if you are streaming
previousMeasures = JSON.parse( localStorage.getItem('hubs-measurements') );
if (!previousMeasures) previousMeasures = []
@EliCDavis
EliCDavis / rotations.go
Created May 12, 2021 16:42
Just my working notes with rotation for later reference
package euler
import (
"math"
"github.com/EliCDavis/vector"
)
// https://stackoverflow.com/questions/1568568/how-to-convert-euler-angles-to-directional-vector
@EliCDavis
EliCDavis / RecurseAdd.cs
Created April 29, 2021 13:36
How to recursively add recorders to a root obj with Recolude
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using RecordAndPlay.Record;
public static class RecurseExample
{
public static void RecurseAdd(Recorder recorder, GameObject obj)
{
if (recorder == null)
@EliCDavis
EliCDavis / UploadExample.cs
Last active October 24, 2020 01:04
Example of how to upload a recording to recolude
using UnityEngine;
using Recolude;
using RecordAndPlay;
using RecordAndPlay.Record;
using System.Collections;
namespace Example
{
public class UploadExample : MonoBehaviour
{
using UnityEngine;
using RecordAndPlay;
using RecordAndPlay.Record;
using RecordAndPlay.Playback;
using System.Collections;
using System.Collections.Generic;
using Recolude;
namespace Example
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Recolude;
namespace Example
{
public class ScoreboardBehavior : MonoBehaviour