Skip to content

Instantly share code, notes, and snippets.

View edsilv's full-sized avatar

Edward Silverton edsilv

View GitHub Profile
@edsilv
edsilv / r3f-video.ts
Created April 25, 2021 20:15
r3f video
import React, { useEffect, useState, useRef } from 'react'
import { Vec3 } from './Types'
import { Image } from './Image'
import { useSpring } from '@react-spring/core'
import { a } from '@react-spring/three'
import { useAsset } from 'use-asset'
export const Video = ({
src,
position = [0, 0, 0],
@edsilv
edsilv / regress.md
Created March 13, 2021 10:24
regress

In the beginning, there was the Word, and the Word was Void.

Gödel looked upon the Void, and comprehended it not. For it was utterly empty.

If only I could measure this expanse, I could know where it begins and ends, he thought.

So Gödel rendered Scale unto the Void, and he saw that it was good.

The Void now lay at his feet, a perfect cube of deepest black.

@edsilv
edsilv / UV.tsx
Last active November 23, 2020 20:26
UV.tsx
import React, { useRef, useLayoutEffect, useEffect, useState } from "react";
// @ts-ignore
import { init, Viewer } from "universalviewer";
import "../../assets/uv.css";
// @ts-ignore
import classNames from "classnames";
const UV = ({
manifest,
embedded = false,
@edsilv
edsilv / iiif-3d-manifest-rendering.json
Created June 11, 2020 14:00
IIIF 3D Manifest (Rendering)
{
"@context": [
"http://www.w3.org/ns/anno.jsonld",
"http://iiif.io/api/presentation//context.json"
],
"id": "https://example.org/iiif/book1/manifest",
"type": "Manifest",
"label": { "en": [ "Image 1" ] },
"items": [
{
@edsilv
edsilv / iiif-3d-manifest.json
Last active June 11, 2020 14:07
IIIF 3D Manifest
{
"@context": [
"http://www.w3.org/ns/anno.jsonld",
"http://iiif.io/api/presentation/3/context.json"
],
"id": "https://example.org/iiif/model1/manifest",
"type": "Manifest",
"label": { "en": [ "Model 1" ] },
"items": [
{
@edsilv
edsilv / machine.js
Last active May 2, 2020 15:56
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@edsilv
edsilv / counter-machine.js
Last active January 6, 2020 10:11
Generated by XState Viz: https://xstate.js.org/viz
const increment = assign({
count: ctx => ctx.count + 1
});
const decrement = assign({
count: ctx => ctx.count - 1
});
const MIN = 0;
const MAX = 10;
@edsilv
edsilv / AmbientLight.cs
Created November 21, 2019 19:28
Ambient Light Fader
using UnityEngine;
using System.Collections;
public class Lighting : MonoBehaviour
{
float duration = 10.0F;
float min = 0.0F;
float max = 1.0F;
static float t = 0.0f;
void Start()
@edsilv
edsilv / scroll-icon.md
Created October 15, 2019 12:18
SVG animated scroll icon
<svg id="alg_mouse_home" xmlns="http://www.w3.org/2000/svg" width="20" height="40" viewBox="0 0 20 40">
<path class="alg_mouse_home_arrow" d="M16.7,32.3c-0.4-0.4-1-0.4-1.4,0L10,37.6l-5.3-5.3c-0.4-0.4-1-0.4-1.4,0c-0.4,0.4-0.4,1,0,1.4c0,0,0,0,0,0l6,6c0.4,0.4,1,0.4,1.4,0l6-6C17.1,33.3,17.1,32.7,16.7,32.3z"></path>
<path class="alg_mouse_home_body" d="M10,2c4.4,0,8,3.6,8,8v10c0,4.4-3.6,8-8,8s-8-3.6-8-8V10C2,5.6,5.6,2,10,2 M10,0C4.5,0,0,4.5,0,10v10c0,5.5,4.5,10,10,10s10-4.5,10-10V10C20,4.5,15.5,0,10,0z M12,12V8c0-1.1-0.9-2-2-2l0,0C8.9,6,8,6.9,8,8v4c0,1.1,0.9,2,2,2l0,0C11.1,14,12,13.1,12,12z"></path>
</svg>
#alg_mouse_home .alg_mouse_home_arrow {
 -moz-animation: bounce 2s infinite;
@edsilv
edsilv / manifest.json
Last active August 12, 2019 10:41
Aleph manifest format
{
"baseurl": "https://www.morphosource.org/media/morphosource/dcm_sample/ptilocercus/dcm_multi_vf300_jpegQ95_16bit/",
"content": [
"dcm_multi_vf300_16bit-001.dcm",
"dcm_multi_vf300_16bit-002.dcm",
"dcm_multi_vf300_16bit-003.dcm"
],
"initialRotation": "180 0 180",
"annotations": {
"nodes": [