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 / Fibonacci.cs
Created June 8, 2023 01:19
FibonacciSphere in Unity3D
View Fibonacci.cs
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
View DrawMeshInstancedDemo.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DrawMeshInstancedDemo : MonoBehaviour {
[SerializeField]
private Color color1;
[SerializeField]
private Color color2;
View hubs_presence.js
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
View rotations.go
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
View RecurseAdd.cs
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)
View ReplayExample.cs
using UnityEngine;
using RecordAndPlay;
using RecordAndPlay.Record;
using RecordAndPlay.Playback;
using System.Collections;
using System.Collections.Generic;
using Recolude;
namespace Example
{
View SearchExample.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Recolude;
namespace Example
{
public class ScoreboardBehavior : MonoBehaviour
@EliCDavis
EliCDavis / UploadExample.cs
Last active October 24, 2020 01:04
Example of how to upload a recording to recolude
View UploadExample.cs
using UnityEngine;
using Recolude;
using RecordAndPlay;
using RecordAndPlay.Record;
using System.Collections;
namespace Example
{
public class UploadExample : MonoBehaviour
{
@EliCDavis
EliCDavis / maximize.go
Created September 25, 2020 14:08
So it seems programs launched by your golang application are only put in the foreground if your golang application itself is in the foreground. So before launching your application, just put your golang application in the foreground first. Here's what I've done to make a program get launched in the foreground, even though the parent program is i…
View maximize.go
package main
import (
"fmt"
"log"
"os"
"os/exec"
"syscall"
"time"
"unsafe"
@EliCDavis
EliCDavis / main.go
Created September 15, 2020 20:29
Find Windows Handle Of Application In Golang
View main.go
package main
import (
"fmt"
"log"
"syscall"
"unsafe"
)
var (