Skip to content

Instantly share code, notes, and snippets.

View forresto's full-sized avatar

Forrest O. forresto

View GitHub Profile
{
"info": {
"title": "spin grid",
"author": "forresto",
"description": "grid spinnn tBoD 4eva",
"url": "spin-grid"
},
"nodes": [
{
"id": 6,
@forresto
forresto / tiptap-lite-youtube.ts
Last active February 25, 2024 18:24
tiptap-lite-youtube node type
// Registers the lite-youtube custom element
import "@justinribeiro/lite-youtube";
import { Node, mergeAttributes } from "@tiptap/core";
import { Plugin, PluginKey } from "prosemirror-state";
// Captures the YouTube ID as the first matching group.
// Vendored 2021-10-07 from https://github.com/micnews/youtube-url/blob/master/index.js
const youtubeRegExp =
/^(?:(?:https?:)?\/\/)?(?:www\.)?(?:m\.)?(?:youtu(?:be)?\.com\/(?:v\/|embed\/|watch(?:\/|\?v=))|youtu\.be\/)((?:\w|-){11})(?:\S+)?$/;
{
"info": {
"author": "meemoo",
"title": "1989-gameboy-looking png",
"description": "dot matrix with stereo sound baby",
"parents": [
"https://gist.github.com/3721129",
"https://gist.github.com/3722026"
],
"url": "dot-matrix"
@forresto
forresto / video-slitscan.meemoo.json
Created April 25, 2021 21:22
video-slitscan.meemoo.json
{
"info": {
"title": "technically the slit is horizontal",
"author": "forresto",
"description": "video file to still image",
"url": "vertical-slitscan"
},
"nodes": [
{
"id": 4,
@forresto
forresto / pickFile.ts
Last active February 3, 2021 18:52
pickFile: vanilla dom typescript function (promise / async friendly) to pick a file (why isn't this a standard dom function?)
/*
// How to use
export const triggerSVGImportFilePicker = async () => {
const files = await pickFile({ accept: ".svg" });
if (files && files.length) {
handleFiles(files);
}
};
*/
@forresto
forresto / hello-vue.js
Last active October 28, 2020 17:36
hello-vue.js
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue! AF is cool.'
}
})
@forresto
forresto / 2020-10-28-coworking-sess.json
Created October 28, 2020 11:39
2020-10-28-coworking-sess.json
{
"info": {
"title": "cam to gif",
"author": "forresto",
"description": "webcam to animated gif",
"url": "2020-10-28-coworking-sess"
},
"nodes": [
{
"id": 1,
@forresto
forresto / vid-split-and-loop.meemoo.json
Created September 19, 2020 16:41
meemoo: webcam to video to multiple players
{
"info": {
"title": "vid split and loop: 1234",
"author": "forresto",
"description": "webcam to video to multiple players",
"url": "vid-split-and-loop"
},
"nodes": [
{
"id": 2,
@forresto
forresto / pingpong.ae.js
Last active August 18, 2020 09:52
ae pingpong scripting pseudocode
// Imagined API
import AE from 'ae'
// Assumes playBackwardDuration is less than playForwardDuration
function (clip, playForwardDuration, playBackwardDuration) {
let time = 0;
const edits = []
while (time < clip.clipDuration) {
let playHead = time;
edits.push(AE.edit(playHead, playHead + playForwardDuration, 1));
@forresto
forresto / machine.js
Last active June 4, 2020 20:24
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)