This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const TimedSequence: React.FC<{ urls: string[]}> = ({ urls }) => { | |
const [allCues, setAllCues] = useState<>(undefined); | |
const [handle] = useState(() => delayRender()); | |
const {fps} = useVideoConfig(); | |
const fetchData = useCallback(async () => { | |
const all = await Promise.all(urls.map(async (url) => | |
({url, durationInSeconds: await getAudioDurationInSeconds(url)}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {_} from 'lodash'; | |
export function makeEnum(arr){ | |
let obj = {}; | |
for (let val of arr){ | |
obj[val] = Symbol(val); | |
} | |
return Object.freeze(obj); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def TriSign(a,b,c): | |
return (a.x - c.x) * (b.y- c.y) - (a.y-c.y) * (b.x-c.x) | |
class pLine: | |
def __init__(self, x1,y1,x2,y2): | |
self.a = PVector(x1,y1) | |
self.b = PVector(x2,y2) | |
def pnorm(self): | |
ret = (self.a - self.b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple Turbulence + art | |
* By Matt Dobler | |
*/ | |
int _w = 1920; | |
int _h = 1080; | |
PVector dim = new PVector(_w, _h); | |
PVector box; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//rendered gif can be found at https://imgur.com/gallery/uADuMZE/ | |
//a rotational for each loop, Runs fn() Spokes times, evenly spaced along a circle len width | |
//supports fractional spokes for 'unfolding' | |
function rotational_for(spokes, len, fn) { | |
var di = TAU / spokes; | |
for (var i = 0; i < spokes; i++) { | |
push(); | |
angle =i*di | |
translate(sin(angle)*len, cos(angle)*len, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
from functools import * | |
import argparse | |
from PIL import Image | |
from colour import Color | |
def interesting_colors(filename, num_colors, steps=32, sample_scale=(200, 200)): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
public class SpoopyEditor : EditorWindow { | |
static float hauntTime = 0; | |
static float hauntSpeed = .005f; | |
static bool haunting = false; | |
public Texture2D skeletons = (Texture2D) Resources.Load("spook/ghost.jpg", typeof(Texture2D)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class _C { | |
/* Screen to world utils */ | |
public static Vector2 ScreenBottomLeft() | |
{ | |
Vector2 dim = new Vector3(0,0,Camera.main.farClipPlane); | |
return Camera.main.ViewportToWorldPoint(dim); | |
return dim; |