Skip to content

Instantly share code, notes, and snippets.

View Sheraff's full-sized avatar

Flo Sheraff

View GitHub Profile
@Sheraff
Sheraff / App.tsx
Last active November 16, 2023 23:35
beenawhile2
//@ts-check
const Component = ({ names }: { names: [string] }) => (
<p>{names[0]}</p>
)
export default function App() {
return <div>Hello world</div>
}
import { Suspense } from "react";
type CacheItem<T> = {
keys: any[]
promise: Promise<T>
error?: unknown
response?: T
}
const cache: CacheItem<any>[] = []
@Sheraff
Sheraff / script.js
Created June 21, 2022 06:19
NEAT string genome
const ACTIVATIONS = [
/*'identity': */x => x,
/*'abs': */ x => Math.abs(x),
/*'clamped': */ x => Math.min(1, Math.max(-1, x)),
/*'cube': */ x => Math.pow(x, 3),
/*'exp': */ x => Math.exp(x),
/*'gauss': */ x => x,
/*'hat': */ x => Math.max(0, x < 0 ? 1 + x : 1 - x),
/*'inv': */ x => 1 / x,
/*'log': */ x => Math.log(x),
@Sheraff
Sheraff / App.jsx
Last active January 19, 2022 16:20
calc
import { useEffect, useRef, useState } from 'react'
import parse from './ast.js'
import { mapCaretToAST } from './mapInputToAST.js'
import AstParser from './AstClass.js'
import {
constPlugin,
groupPlugin,
numberPlugin,
stringPlugin,
leftUnaryOperatorsPlugin,
@Sheraff
Sheraff / codeswing.json
Last active December 9, 2021 08:12
compositing spinner
{
"scripts": [],
"styles": []
}
@Sheraff
Sheraff / codeswing.json
Last active December 8, 2021 05:16
input range
{
"scripts": [],
"styles": []
}
@Sheraff
Sheraff / codeswing.json
Last active November 5, 2021 19:42
styled text on canvas
{
"scripts": [],
"styles": []
}
@Sheraff
Sheraff / codeswing.json
Last active August 28, 2021 09:47
ApeOut 3D scroll spacer
{
"scripts": [],
"styles": [],
"themePreview": false
}
@Sheraff
Sheraff / codeswing.json
Last active August 20, 2021 12:51
span dialog
{
"scripts": [],
"styles": []
}
@Sheraff
Sheraff / codeswing.json
Last active July 29, 2021 07:10
unidirectional motion blur (SVG)$
{
"scripts": [],
"styles": []
}