Skip to content

Instantly share code, notes, and snippets.

View edsilv's full-sized avatar

Edward Silverton edsilv

View GitHub Profile
@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": [
@edsilv
edsilv / guide.md
Created July 31, 2019 10:18
gitlab credentials management on windows
@edsilv
edsilv / gist:e27402ee608ce2ab1ae5ef37d200681b
Last active June 2, 2019 12:33
git checkout PR on upstream to new branch
git fetch [email protected]:aframevr/aframe.git refs/pull/4043/head
git checkout -b webgl2 FETCH_HEAD
@edsilv
edsilv / lion-annotations.json
Created April 23, 2019 13:35
Lion annotations
{"nodes":[["node-0",{"targetId":"0","position":"-0.0026676679559195504 0.025189044586043124 0.004516586643444194","scale":0.0020165806053690015,"title":"What is it made of?","description":"This lion figure is carved from wood."}],["node-2",{"targetId":"0","position":"-0.07015366117556757 0.027889620737464465 0.006348005032900353","scale":0.0020165806053690015,"title":"Where does it come from?","description":"It was acquired in Hargeisa, Somaliland a self-declared state."}],["node-3",{"targetId":"0","position":"0.09219381437374952 -0.022571635710918383 0.0075862942330654935","scale":0.0020165806053690015,"title":"What does it symbolise?","description":"This lion figure reflects the wildlife that once thrived in these regions before the civil war"}],["node-4",{"targetId":"0","position":"-0.078630211768072 -0.028944212018522125 -0.0065977882102052415","scale":0.0020165806053690015,"title":"How is it used?","description":"It is used as a toy for a small child but can also be ornamental."}]],"edges":[],"angles":[]
@edsilv
edsilv / manifest.json
Last active December 19, 2018 15:19
equirectangular image manifest
"id": "...",
"type": "Canvas",
"items": [{
"id": "...",
"type": "AnnotationPage",
"items": [{
"id": "...",
"type": "Annotation",
"motivation": "painting",
"body": {
@edsilv
edsilv / cla
Last active October 10, 2018 16:07
CLA
Thank you for your interest in contributing to the open source projects (“Projects”) made available by Edward Silverton ("Creator"). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to the Creator in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact [email protected].
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
Copyright License. You hereby grant, and agree to grant, to the Creator a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable cop