Skip to content

Instantly share code, notes, and snippets.

View mysterycommand's full-sized avatar

Matt Hayes mysterycommand

View GitHub Profile
@kamilogorek
kamilogorek / _screenshot.md
Last active May 27, 2024 12:50
Clutter-free VS Code Setup
image
@surma
surma / .gitignore
Last active June 17, 2022 18:53
Moving a Three.JS-based WebXR app to a worker
node_modules
build
package-lock.json
<script>
import { Color, Slider, Props } from "txl";
export let inner = 0.5;
export let outer = 0.75;
export let vertices = 10;
function enter ({ context, width, height }) {
const cx = width / 2;
const cy = height / 2;
<script>
import { Props, Color, Slider } from "txl";
export let positions = [];
export let cells = [];
export let strokeStyle = '#000000';
export let lineJoin = 'round';
export let lineCap = 'round';
export let lineWidth = 1;
<script>
import LinearGradient from '@mattdesl/components/LinearGradient.txl';
import NoiseLines from '@mattdesl/components/NoiseLines.txl';
</script>
<LinearGradient />
<NoiseLines />
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
// inspired by a tweet by Joanie Lemercier : https://twitter.com/JoanieLemercier/status/1146851204875661313
// also : related tutorial : https://necessarydisorder.wordpress.com/2019/02/20/distortion-or-smoke-effect-on-parametric-curves/
int[][] result;
float t, c;
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@getify
getify / 1.md
Last active October 15, 2020 01:44
BetterPromise: a strawman experiment in subclassing Promise and "fixing" a bunch of its awkward/bad parts

Some things that are "better" with this BetterPromise implementation:

  • BetterPromise # then(..) accepts a BetterPromise (or Promise) instance passed directly, instead of requiring a function to return it, so that the promise is linked into the chain.

    var p = BetterPromise.resolve(42);
    
    var q = Promise.resolve(10);
    
    p.then(console.log).then(q).then(console.log);
@edwardrowe
edwardrowe / LightmapCutout
Last active June 17, 2018 00:47
Unity ShaderLab Retro Cutout Lighting Shaders
Shader "RedBlueGames/Lighting/LightMapCutout"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_DarknessColor ("Darkness Color", Color) = (0,0,0.18,.24)
}
SubShader
{
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.